import java.io.*;
File f=new File("file.txt");
你的需求完全可以解决

解决方案 »

  1.   

    boolean canRead() 
              Tests whether the application can read the file denoted by this abstract pathname.  boolean canWrite() 
              Tests whether the application can modify to the file denoted by this abstract pathname.  boolean isHidden() 
              Tests whether the file named by this abstract pathname is a hidden file.  long lastModified() 
              Returns the time that the file denoted by this abstract pathname was last modified.  boolean setLastModified(long time) 
              Sets the last-modified time of the file or directory named by this abstract pathname.  boolean setReadOnly() 
              Marks the file or directory named by this abstract pathname so that only read operations are allowed. 
      

  2.   

    多谢高手指点,可是我看到API中没有将生成文件设置为隐藏文件类型的,不知道有没有方法帮我解决一下?多谢多谢,盼答案
      

  3.   

    java是跨平台的语言,隐藏文件在windows的ntfs文件系统中有,我对其他平台不熟悉,但我可以肯定这样的属性不可能是每个平台的文件都有的,所以API中没有这个方法也就顺理成章啦