java list get element by index

www.lautt‮c.iru‬om
java list get element by index
/**
 * @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
Created Time:2017-09-26 15:23:33  Author:lautturi