- C# code
class VeryImportantException extends Exception{ public String toString(){ return "A very important exception!"; }}class HoHumException extends Exception { public String toString(){ return "A trivial exception"; }}public class Te{ void f() throws VeryImportantException{ throw new VeryImportantException(); } void dispose() throws HoHumException{ throw new HoHumException (); } public static void main void main(String[] args)throws Exception{ Te te = new Te(); try{ te.f(); }finally{ te.dispose(); } }}
直接上代码了 - - main下面老是有波浪线
------解决方案--------------------
改成下面这样试试
- Java code
class VeryImportantException extends Exception{ public String toString(){ return "A very important exception!"; }}class HoHumException extends Exception { public String toString(){ return "A trivial exception"; }}public class Te{ void f() throws VeryImportantException{ throw new VeryImportantException(); } void dispose() throws HoHumException{ throw new HoHumException (); } public static void main (String[] args)throws Exception{ Te te = new Te(); try{ te.f(); }finally{ te.dispose(); } }}
------解决方案--------------------
明显的代码错误
- Java code
public static void main void main(String[] args)
------解决方案--------------------
- Java code
public static void main void main(String[] args)
------解决方案--------------------
public static void main void main(String[] args)throws Exception
两个void main 啊
------解决方案--------------------
这个貌似在考验大家的仔细度,多了一个void main ,楼主写代码要仔细点哦。
------解决方案--------------------
------解决方案--------------------
汗......
------解决方案--------------------
汗。。楼主是在搞啥。。。
------解决方案--------------------
------解决方案--------------------
要仔细~~~~