A good answer might be:

The complted program is below.


Completed Program

If the Vector has no elements, then the enumeration will be empty, and hasMoreElements() will evaluate to false.

import java.util.* ;
class VectorEg
{
  public static void main ( String[] args)
  {
    Vector names = new Vector( 10 );

    names.addElement( "Amy" );    names.addElement( "Bob" ); 
    names.addElement( "Chris" );  names.addElement( "Deb" ); 
    names.addElement( "Elaine" ); names.addElement( "Frank" );
    names.addElement( "Gail" );   names.addElement( "Hal" );

    Enumeration enum = names.elements();

    while ( enum.hasMoreElements() )
      System.out.println(enum.nextElement());

  }
}

QUESTION 18:

(Review: ) What is the type of each slot of a Vector object? (In other words, what is the contents of each slot?)