Vidyalelo
Java Programming · Q7

Array

Programming · Java Programming · question 7

Q7

What happens if you try to access an array element at an index that is out of bounds in Java?

A.
It returns null.
B.
It throws an ArrayIndexOutOfBoundsException.
Answer
C.
It returns 0.
D.
It returns -1.

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board