// illustrates inheritance and use of this import java.util.TreeSet; import java.util.Iterator; class TreeSetHelper2 extends TreeSet // inheritance { public void print() {Iterator it = this.iterator(); // and this while (it.hasNext()) {System.out.println(it.next()); } } } ************************************** import java.io.*; public class TreeSetDriver2 { public static void main(String[] args) throws IOException {TreeSetHelper t = new TreeSetHelper(); t.add("Mary"); t.add("Tom"); t.add("Ellen"); t.add("Jack"); t.add("Joe"); t.add("Kelly"); t.add("Nancy"); t.add("Bob"); t.print(); t.remove("Jack"); System.out.println(); t.print(); } }