[問題] IO處理
書上的一個例子:
import java.io.*;
public class writeTest
{
public static void main(String[] args) throws IOException
------------------
{
FileWriter output = new FileWriter("hi.txt",true);
output.write("hello");
output.close();
}
}
請問為什麼一定要加 throws IOException 呢?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 122.126.46.105
推
12/11 08:14, , 1F
12/11 08:14, 1F
推
12/11 11:37, , 2F
12/11 11:37, 2F
推
12/11 12:21, , 3F
12/11 12:21, 3F
推
12/11 12:22, , 4F
12/11 12:22, 4F
→
12/12 15:51, , 5F
12/12 15:51, 5F
推
12/12 20:44, , 6F
12/12 20:44, 6F
討論串 (同標題文章)