关于在FileNotFoundException构造体的疑问
private FileNotFoundException(String path, String reason) {
super(path + ((reason == null)
? " "
: " ( " + reason + ") "));
}
请问这个私有构造体有什么作用呢
[解决办法]
This private constructor is invoked only by native I/O methods.
[解决办法]
FileNotFoundException提供了public FileNotFoundException()和public FileNotFoundException(String s)两个public方法供我们用,而private FileNotFoundException(String path, String reason)这个方法指示供FileNotFoundException内部使用的。