Check out example codes for "java declare arraylist with int values". It will help you in understanding the concepts better.

Code Example 1

ArrayList<Integer> numbers = new ArrayList<>(Arrays. asList(1, 2, 3, 4, 5, 6));

Learn ReactJs, React Native from akashmittal.com