Thrown to indicate that some index (array, string, vector, etc.) is out of range.
Exception that occurs when accessing ** List, ArrayList **, etc. using an invalid index
Initialization
import java.util.ArrayList; //Package import required
import java.util.List;
ArrayList <Reference type>list name= new ArrayList<>();
List <Reference type>list name= new ArrayList<>(); 
//It is also possible to declare with the List type interface implemented by ArrayList.
--You can handle ** any type of object . ** Mixed type ** is also possible --Automatically increase the number of elements as needed (variable length) ** - Arrange in the order of addition ** -** null ** can also be added as a value -** Duplicate ** is allowed --Not thread safe. An exception (ConcurrentModificationException) occurs when an element is changed during reading.
ArrayIndexOutOfBoundsException
A subclass of IndexOutOfBoundsException.
Thrown to indicate that the array was accessed using an invalid index. That is, if the index is negative or greater than or equal to the size of the array.
Exception that occurs when accessing ** array ** using an invalid index
·Initialization
int a = new int[3]; //Allocate memory as an array with 3 elements
int b [] = {1,2}; //Can be initialized only with an initializer without using new
int[]c = new int []{1,2}; //If you use both new and initializer[]Inside is empty
int[] d;
d = new int[]{2,3};
-** Only the same type ** or compatible types can be handled --It is necessary to ** decide the number of elements to handle first ** --Subscripts must be used for element access --When accessing elements, it is necessary not to exceed the number of elements
ArrayList, List are not arrays!
[Java] Difference between ArrayIndexOutOfBoundsException and IndexOutOfBoundsException