import java.util.*; public class CollectionInterfaceClearMethodExample { public static void main(String[] args) { Collection collection = new ArrayList(); collection.add(1); collection.add(2); collection.add(3); System.out.print("Elements of the Array List before use of clear method "); System.out.println(collection + "."); collection.clear(); System.out.print("Elements of the Array List after use of clear method "); System.out.println(collection + "."); } }