how to add a number to an array in java

Java
List<Integer> myList = new ArrayList<Integer>();
myList.add(5);
myList.add(7);
Source

Also in Java: