ArrayList<String> arrlist = new ArrayList<String>();
// Populating arrlist1
arrlist.add("A");
arrlist.add("B");
arrlist.add("C");
arrlist.add("D");
arrlist.add("E");
// print arrlist
System.out.println("Original arrlist: "
+ arrlist);
// getting the subList
// using subList() method
List<String> arrlist2 = arrlist.subList(2, 4);