Q. If you are inserting any value in the wrong index as shown below,

1. int a[]=new int[5];
2. a[10]=50;

it would result in ______.

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

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
193
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Jatin Dubey
Publisher
πŸ“ˆ
99%
Success Rate