读书人

Java是不是强制try语句了,该怎么处理

发布时间: 2012-02-29 16:44:11 作者: rapoo

Java是不是强制try语句了
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

[解决办法]
不想用try 把他抛出去 在方法后面写throws Exception {


建议使用try catch 块
[解决办法]
must be caught or declared to be thrown,可以try可以throws

读书人网 >J2SE开发

热点推荐