ListmyList = new ArrayList<>(); myList.add("apple"); myList.add("banana"); myList.add("orange");
myList.add("grape"); myList.add(2, "watermelon");
myList.remove("banana");
String firstElement = myList.get(0); System.out.println(firstElement);In all of these examples, we are using the java.util.List interface, which is part of the Java Standard Library.