当前位置: 移动技术网 > IT编程>开发语言>Java > java IO异常处理

java IO异常处理

2020年04月10日  | 移动技术网IT编程  | 我要评论
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();
            }
        }
    }
}

 

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网