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下面老是有波浪线
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下面老是有波浪线
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();
}
}
}
public static void main void main(String[] args)这个明显的错误
改正:public static void main(String[] args)
两个void main 啊