FileDocCategorySizeDatePackage
Set1.javaAPI DocExample2988Mon Apr 06 18:10:26 BST 1998c08.newcollections

Set1

public class Set1 extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

    testVisual(new HashSet());
    testVisual(new TreeSet());
  
public static voidtestVisual(java.util.Set a)

    Collection1.fill(a);
    Collection1.fill(a);
    Collection1.fill(a);
    Collection1.print(a); // No duplicates!
    // Add another set to this one:
    a.addAll(a);
    a.add("one"); 
    a.add("one"); 
    a.add("one");
    Collection1.print(a);
    // Look something up:
    System.out.println("a.contains(\"one\"): " +
      a.contains("one"));