java IO异常处理
程序员文章站
2022-03-26 23:13:21
public class FileWriterDemo { public static void main(String[] args) { FileWriter fw = null; try { fw = new FileWriter("s:\\demo.txt"); fw.write("abcd ......
public class filewriterdemo { public static void main(string[] args) { filewriter fw = null; try { fw = new filewriter("s:\\demo.txt"); fw.write("abcde"); } catch (ioexception e) { system.out.println(e.tostring()); } finally { try { if (fw != null) fw.close(); } catch (ioexception e) { e.printstacktrace(); } } } }