// Erika Wolfe // Simple example of using an interface to write general code that can be // applied to two types of list objects. public class ListClient { public static void main(String[] args) { IntList list1 = new ArrayIntList(); processList(list1); IntList list2 = new LinkedIntList(); processList(list2); // This doesn't compile because we cannot // instantiate an IntList- // IntList list3 = new IntList(); } // Does some simple operations with the given list // and prints the result public static void processList(IntList list) { list.add(18); list.add(27); list.add(93); System.out.println(list); list.remove(1); System.out.println(list); } }