/** * @author lautturi.com * Java example: java get item of list by index */ import java.util.*; public class Lautturi { public static void main(String[] args) { List<Integer> list = new ArrayList<Integer>(); list.add(3); list.add(7); list.add(15); list.add(8); list.add(22); list.add(12); // get the element at the index 3 of the list Integer ele = list.get(3); System.out.println(ele); } }
output:
8