import java.util.ArrayList; import java.util.List; public class Example { public static void main(String[] args) { ListIn this example, we create a List of Strings using the ArrayList class. We add three elements to the List, print the List to the console, then call the clear() method to remove all the elements from the List. Finally, we print the empty List to the console. The List interface is part of the java.util package, which is a package library in Java that provides utility classes and interfaces for working with data structures, such as Lists, Maps, and Sets.stringList = new ArrayList<>(); stringList.add("apple"); stringList.add("banana"); stringList.add("orange"); System.out.println(stringList); // [apple, banana, orange] stringList.clear(); System.out.println(stringList); // [] } }