MCQ Single Best Answer Not Set

Q
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?

ID: #2324 Java Exception MCQ 906 views
Question Info
#2324Q ID
Not SetDifficulty
Java Exception MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A IllegalStateException
  • B NumberFormatException
  • C ClassCastException
  • D ArrayIndexOutOfBoundsException
Correct Answer: Option B

Explanation

NumberFormatException

Share This Question

Challenge a friend or share with your study group.