1import java.util.ArrayList;
2public class ArrayListGetExample
3{
4 public static void main(String[] args)
5 {
6 ArrayList<String> al = new ArrayList<String>();
7 al.add("lion");
8 al.add("tiger");
9 al.add("deer");
10 al.add("cheetah");
11 al.add("elephant");
12 al.add("fox");
13 al.add("hyenas");
14 al.add("jackal");
15 System.out.println("Get second element of ArrayList: " + al.get(1));
16 System.out.println("Get third element of ArrayList: " + al.get(2));
17 System.out.println("Get fifth element of ArrayList: " + al.get(4));
18 System.out.println("Get sixth element of ArrayList: " + al.get(5));
19 }
20}