FileDocCategorySizeDatePackage
SetDemo.javaAPI DocExample458Sun Feb 08 21:34:04 GMT 2004None

SetDemo

public class SetDemo extends Object
Demonstrate the Set interface
author
Ian F. Darwin, http://www.darwinsys.com/
version
$Id: SetDemo.java,v 1.4 2004/02/09 03:34:04 ian Exp $

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

		//+
		Set 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());
		}
		//-