Check out example codes for "how to add a number to an array in java". It will help you in understanding the concepts better.

Code Example 1

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

Learn ReactJs, React Native from akashmittal.com