Examveda

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?

A. IllegalStateException

B. NumberFormatException

C. ClassCastException

D. ArrayIndexOutOfBoundsException

E. None of these

Answer: Option B


This Question Belongs to Java Program >> Exceptions

Join The Discussion

Comments (1)

  1. Raj Grover
    Raj Grover:
    9 years ago

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

Related Questions on Exceptions