What will happen if you try to access an element at an invalid index using get(int index)?

Last Updated :
Discuss
Comments

What will happen if you try to access an element at an invalid index using get(int index)?


It returns null

It returns 0

It throws IndexOutOfBoundsException

It removes the last element

Share your thoughts in the comments