import java.io.*;
class FileTest
{
public static void main(String args[])
{
try{
File afile=new File("c:\\temp\temp.txt");
RandomAccessFile rafile=new RandomAccessFile(afile,"rw");
}
catch(IOException e)
{
e.printStackTrace();
}
}
此段编译 能通过吗?我觉得应该抛出一个文件没有找到的异常才对。因为编译器不能识别("c:\\temp\temp.txt");此路径。正确的应该是“c:\\temp\\temp.txt”。
class FileTest
{
public static void main(String args[])
{
try{
File afile=new File("c:\\temp\temp.txt");
RandomAccessFile rafile=new RandomAccessFile(afile,"rw");
}
catch(IOException e)
{
e.printStackTrace();
}
}
此段编译 能通过吗?我觉得应该抛出一个文件没有找到的异常才对。因为编译器不能识别("c:\\temp\temp.txt");此路径。正确的应该是“c:\\temp\\temp.txt”。
建议你学者在JBUILDER里编辑和编译,这样会让你编写JAVA程序事半功倍。
" => \"