File f = new File("E:\\aaa"); f.mkdir(); 有返回值也一样可以的了 只是判断创建成功与否的标志
Microsoft Windows XP [版本 5.1.2600] (C) 版权所有 1985-2001 Microsoft Corp.C:\Documents and Settings\Administrator>d:D:\>cd jdkD:\jdk>javac NewFile.java NewFile.java:5: cannot resolve symbol symbol : class File location: class NewFile File f = new File("D:\\gong"); ^ NewFile.java:5: cannot resolve symbol symbol : class File location: class NewFile File f = new File("D:\\gong"); ^ 2 errorsD:\jdk>javac TextNewFile javac: invalid flag: TextNewFile Usage: javac <options> <source files> where possible options include: -g Generate all debugging info -g:none Generate no debugging info -g:{lines,vars,source} Generate only some debugging info -nowarn Generate no warnings -verbose Output messages about what the compiler is doing -deprecation Output source locations where deprecated APIs are us ed -classpath <path> Specify where to find user class files -sourcepath <path> Specify where to find input source files -bootclasspath <path> Override location of bootstrap class files -extdirs <dirs> Override location of installed extensions -d <directory> Specify where to place generated class files -encoding <encoding> Specify character encoding used by source files -source <release> Provide source compatibility with specified release -target <release> Generate class files for specific VM version -help Print a synopsis of standard options D:\jdk>javac TextNewFile.java TextNewFile.java:5: cannot resolve symbol symbol : class File location: class TextNewFile File f = new File("D:\\gong"); ^ TextNewFile.java:5: cannot resolve symbol symbol : class File location: class TextNewFile File f = new File("D:\\gong"); ^ 2 errorsD:\jdk>javac TextNewFile.java TextNewFile.java:5: cannot resolve symbol symbol : class File location: class TextNewFile File f = new File("D:\\aaa"); ^ TextNewFile.java:5: cannot resolve symbol symbol : class File location: class TextNewFile File f = new File("D:\\aaa"); ^ 2 errorsD:\jdk>javac TextNewFile.java TextNewFile.java:5: cannot resolve symbol symbol : class File location: class TextNewFile File f = new File("E:\\aaa"); ^ TextNewFile.java:5: cannot resolve symbol symbol : class File location: class TextNewFile File f = new File("E:\\aaa"); ^ 2 errorsD:\jdk> 编译时出现这个错误!什么原因啊!等待.....
File f = new File("E:\\aaa");
f.mkdir();
f.mkdir();
有返回值也一样可以的了
只是判断创建成功与否的标志
(C) 版权所有 1985-2001 Microsoft Corp.C:\Documents and Settings\Administrator>d:D:\>cd jdkD:\jdk>javac NewFile.java
NewFile.java:5: cannot resolve symbol
symbol : class File
location: class NewFile
File f = new File("D:\\gong");
^
NewFile.java:5: cannot resolve symbol
symbol : class File
location: class NewFile
File f = new File("D:\\gong");
^
2 errorsD:\jdk>javac TextNewFile
javac: invalid flag: TextNewFile
Usage: javac <options> <source files>
where possible options include:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging info
-nowarn Generate no warnings
-verbose Output messages about what the compiler is doing
-deprecation Output source locations where deprecated APIs are us
ed
-classpath <path> Specify where to find user class files
-sourcepath <path> Specify where to find input source files
-bootclasspath <path> Override location of bootstrap class files
-extdirs <dirs> Override location of installed extensions
-d <directory> Specify where to place generated class files
-encoding <encoding> Specify character encoding used by source files
-source <release> Provide source compatibility with specified release
-target <release> Generate class files for specific VM version
-help Print a synopsis of standard options
D:\jdk>javac TextNewFile.java
TextNewFile.java:5: cannot resolve symbol
symbol : class File
location: class TextNewFile
File f = new File("D:\\gong");
^
TextNewFile.java:5: cannot resolve symbol
symbol : class File
location: class TextNewFile
File f = new File("D:\\gong");
^
2 errorsD:\jdk>javac TextNewFile.java
TextNewFile.java:5: cannot resolve symbol
symbol : class File
location: class TextNewFile
File f = new File("D:\\aaa");
^
TextNewFile.java:5: cannot resolve symbol
symbol : class File
location: class TextNewFile
File f = new File("D:\\aaa");
^
2 errorsD:\jdk>javac TextNewFile.java
TextNewFile.java:5: cannot resolve symbol
symbol : class File
location: class TextNewFile
File f = new File("E:\\aaa");
^
TextNewFile.java:5: cannot resolve symbol
symbol : class File
location: class TextNewFile
File f = new File("E:\\aaa");
^
2 errorsD:\jdk>
编译时出现这个错误!什么原因啊!等待.....
...
import java.io.File;
...
class abc{
...
}