下面这段程序只执行到File file=new file("f:\\programme");就不向下执行了,并且提示cannot find symbol class file这是什么原因.
import java.io.File;
class file0801
{
public static void main(String args[])
{
File file=new file("f:\\programme");
if(file.exists())
{
System.out.println ("文件夹已经存在");//如果存在就不用建立
}
else
{
file.mkdir();//没有存在就在建立一个
}
}
}
import java.io.File;
class file0801
{
public static void main(String args[])
{
File file=new file("f:\\programme");
if(file.exists())
{
System.out.println ("文件夹已经存在");//如果存在就不用建立
}
else
{
file.mkdir();//没有存在就在建立一个
}
}
}
File file = new File("C:\\testAA");
if(file.exists() && file.isDirectory())
System.out.println("folder " + file.getAbsolutePath() + " exist!");
else
System.out.println(file.mkdir());
这个能编译过?汗。。
File sfile=new File(filename); //实例化一个文件 if (!sfile.exists()){ //如果文件不存在
showMessage(filename+" 文件不存在."); //显示信息