【发布时间】:2016-08-03 13:40:59
【问题描述】:
File file = new File("D:/projects/tFile.txt") ;
file.createNewFile(); //Unhandled exception type IOException
FileOutputStream fout = new FileOutputStream(file); //Unhandled exception type FileNotFoundException
String s = "Cricket";
byte []b = s.getBytes();
fout.write(b);//Unhandled exception type IOException
fout.close();// Unhandled exception type IOException
这显示了 FileNotFound Exception 和 IoException。
【问题讨论】:
-
当您对错误有疑问时,请确保在您的问题中包括错误是编译时还是运行时、错误发生在哪一行以及完成 错误文本。
-
您是否费心在 Google 上搜索这些错误以努力了解它们是什么、为什么会发生以及可能有哪些潜在的修复方法?
-
您是否阅读过错误消息?
标签: java