sublist in java

Java
ArrayList<String> list = new ArrayList<String>(); 
List<String> sublist = list.subList(2, 4); 
Source

Also in Java: