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?

  • (A) IllegalStateException
  • (B) NumberFormatException
  • (C) ClassCastException
  • (D) ClassCastException D. ArrayIndexOutOfBoundsException
πŸ’¬ Discuss
βœ… Correct Answer: (B) NumberFormatException

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
177
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Sonali Mishra
Publisher
πŸ“ˆ
89%
Success Rate