netbeans7.1
我用URL类提示我要用Try语句,写个System.in.read()也要用Try语句。疯了
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - unreported exception java.io.IOException; must be caught or declared to be thrown
at hashdos.HashDos.main

解决方案 »

  1.   

    不想用try  把他抛出去 在方法后面写throws Exception {
    建议使用try catch 块 
      

  2.   

    must be caught or declared to be thrown,可以try可以throws
      

  3.   

    了解了。谢谢。
    感觉Java大哆嗦了。
      

  4.   

    你调用的方法如果有可能抛出异常,你的代码中就必须
    1) catch这个异常
    或者
    2) 继续向外抛这个异常二者必居其一。具体用1)还是2)根据实际情况的需要了