本帖最后由 張帅 于 2013-10-11 14:45 编辑
import java.io.*;
class FileWriterDemo
{
public static void main(String[] args)
{
FileWriter fw = null;
try
{
fw = new FileWriter("k:\\demo.txt");
fw.write("nihao");
}
catch(IOException e)
{
System.out.println("catch="+e.toString());
}
finally
{
try
{
fw.close();
}
catch(IOException e)
{
System.out.println("catch="+e.toString());
}
}
}
}
//问题:我这个 异常程序编译能通过,但是到了运行时就报错了怎么回事? |