The List interface is used to create ordered collections that can contain duplicate elements.
Source Code
import java.util.ArrayList;
import java.util.List;
public class TestList {
public static void main(String[] args) {
List list = new ArrayList();
list.add("Hello");
list.add("World");
System.out.println(list.get(0)); // Access elements
}
}