这里是我的代码为什么我会收到错误“文件无法解析为类型”?
try{
BufferedReader in= new BufferedReader(new InputStreamReader(System.in));
while ((line= in.readLine())!="exit"){
System.out.println("Enter command");
line=in.readLine();
Command currentCommand=new Command(line);
File currentFile= new File(currentCommand.getLsPath());
currentCommand.getLsPath()
返回一个字符串,这是mendatory的文件Constracture的方法的一部分,我仍然得到这个错误:File cannot be resolved to a type
问题是什么?
您是否导入了java.io.File? – JustinKSU 2011-05-13 19:46:24