FileDocCategorySizeDatePackage
ArrayListDemo.javaAPI DocExample589Sat Nov 25 12:56:20 GMT 2000None

ArrayListDemo

public class ArrayListDemo extends Object
ArrayListDemo done over using an ArrayList

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

		ArrayList al = new ArrayList();

		// Create a source of Objects
		StructureDemo source = new StructureDemo(15);

		// Add lots of elements to the ArrayList...
		al.add(source.getDate());
		al.add(source.getDate());
		al.add(source.getDate());

		// First print them out using a for loop.
		System.out.println("Retrieving by index:");
		for (int i = 0; i<al.size(); i++) {
			System.out.println("Element " + i + " = " + al.get(i));
		}