FileDocCategorySizeDatePackage
SetDemo.javaAPI DocExample454Sat Nov 25 12:56:22 GMT 2000None

SetDemo

public class SetDemo extends Object
Demonstrate the Set interface
author
Ian F. Darwin, ian@darwinsys.com
version
$Id: SetDemo.java,v 1.2 2000/11/25 17:56:23 ian Exp $

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

		//+
		HashSet h = new HashSet();
		h.add("One");
		h.add("Two");
		h.add("One"); // DUPLICATE
		h.add("Three");
		Iterator it = h.iterator();
		while (it.hasNext()) {
			System.out.println(it.next());
		}
		//-