FileDocCategorySizeDatePackage
LinkedListDemo.javaAPI DocExample740Sat Nov 25 12:56:22 GMT 2000None

LinkedListDemo

public class LinkedListDemo extends Object
Demo of 1.2 java.util.LinkedList class using same example as my older LinkList class.
author
Ian Darwin, ian@darwinsys.com
version
$Id: LinkedListDemo.java,v 1.2 2000/11/25 17:56:22 ian Exp $

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

		System.out.println("Here is a demo of Java 1.2's LinkedList class");
		LinkedList l = new LinkedList();
		l.add(new Object());
		l.add("Hello");

		System.out.println("Here is a list of all the elements");
		ListIterator li = l.listIterator(0);
		while (li.hasNext())
			System.out.println(li.next());

		if (l.indexOf("Hello") < 0)
			System.err.println("Lookup does not work");
		else
			System.err.println("Lookup works");