how to get values from an arraylist in java code example
Example 1: java arraylist access index
List<String> cities = new ArrayList<String>();
cities.add("Tuguegarao City");
cities.add("Tabuk City");
cities.add("Davao City");
System.out.println(cities.get(1)); //prints "Tabuk City"
Example 2: arraylist get value at index java
get(index);
Example 3: java first index of an arraylist
ArrayList<Type> array = new ArrayList<Type>();
System.out.printLn(array[0]);