当前位置: 代码迷 >> J2SE >> 关于在FileNotFoundException构造体的疑问,该如何处理
  详细解决方案

关于在FileNotFoundException构造体的疑问,该如何处理

热度:104   发布时间:2016-04-24 16:34:43.0
关于在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内部使用的。
  相关解决方案