Examveda
Examveda

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.

C. It returns -1.

D. It throws an IndexOutOfBoundsException.

Answer: Option B


This Question Belongs to Java Program >> Array

Join The Discussion

Related Questions on Array