import java.io.*;
class test{
public static void main(String[] args)throws IOException
{
FileWriter fw = new FileWriter("test.txt");
String a = "hello!\n";
int i;
for(i = 0;i<10;i++){
fw.write(a,0,a.length());
}
fw.flush();
}
}
请问上面程序中 throws IOException 是什么意思?起什么作用呢?
谢谢!
class test{
public static void main(String[] args)throws IOException
{
FileWriter fw = new FileWriter("test.txt");
String a = "hello!\n";
int i;
for(i = 0;i<10;i++){
fw.write(a,0,a.length());
}
fw.flush();
}
}
请问上面程序中 throws IOException 是什么意思?起什么作用呢?
谢谢!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货