Code: Select all
public static void main (String [] args){
a();
}
public static void a(){
//non-throwing exception code...
}
public static void b() throws IOException{
throw new IOException();
}
//no compilation error
Code: Select all
public static void main (String [] args){
a(); //compilation error, unhandled exception
}
public static void a() throws IOException{
//not throwing exception code...
b();
}
public static void b() throws IOException{
throw new IOException();
}