class ExceptionTest{
public static void main(String args[]){
try{
methodA();
}catch(IOException e){
System.out.println("caught IOException");
}catch(Exception e){
System.out.println("caught Exception");
}
}
public void method(){
throws IOException();
}
}
If methodA() throws a IOException, what is the result?
Why the program doesn't complie?
public static void main(String args[]){
try{
methodA();
}catch(IOException e){
System.out.println("caught IOException");
}catch(Exception e){
System.out.println("caught Exception");
}
}
public void method(){
throws IOException();
}
}
If methodA() throws a IOException, what is the result?
Why the program doesn't complie?