Source code for RamboFiestyExample.java:

import java.util.*;

public class RamboFiestyExample
{
	public static void main(String args[])
	{
		// RamboFiestyExample
		Vector dogs = new Vector();
		dogs.add("Rambo");
		dogs.add("Feisty");
		Enumeration names = dogs.elements();
		System.out.println(names.hasMoreElements());
		System.out.println(names.nextElement());
		System.out.println(names.hasMoreElements());
		System.out.println(names.nextElement());
		System.out.println(names.hasMoreElements());
	}
}

Output from RamboFiestyExample.java:

true Rambo true Feisty false

--- Output Ends ---

NOTE:

You are reading previously generated output. You are not currently running the RamboFiestyExample application at the momement. You need to compile and run the source code first.

To run this program:


Authors: Kevin Chu and Eric Brower
Copyright 2000 Prentice Hall PTR