public class Test{
public static void main(String args[]){
try{
int a = Integer.parseInt("four");
}
}
}
Which exception could be handled by the catch block for above?
public class Test{
public static void main(String args[]){
try{
int a = Integer.parseInt("four");
}
}
}A. IllegalStateException
B. NumberFormatException
C. ClassCastException
D. ArrayIndexOutOfBoundsException
E. None of these
Answer: Option B

but we are using try without catch... so it should throw compilation exception that (try without catch)