Vidyalelo
Java Programming · Q24

Array

Programming · Java Programming · question 24

Q24

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

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

Answer: Option B

Solution

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