此行代码没有问题,是否引入了java.io.*

解决方案 »

  1.   

    File aFile=new File("d:\\temp\\temp.java");
      

  2.   

    有啊,但如果我把它写成这样就没问题了:
     File aFile=new File("d:\temp.java");
     ???????????????Why???????????????
      

  3.   

    谢谢各位的帮助。但为什么要这样呢?File aFile=new File("d:\\temp\\temp.java");
      

  4.   

    因为在VC和JAVA里,\被认为特殊字符的起始符,比如\n是回车,\\编译时才认为是\,大概是这个样子吧