
/*

	Tom DeDonno page 675

	improved version of VectorDemo
	with clone feature
*/

import java.util.Vector;

public class VectorDemo1 {

	public static void main( String[] args ) {

		Vector toDoList = new Vector( 10 );

		System.out.println( 
		"Enter items for the list, when prompted." );
		String next = null;
		char ans;

		while( true ) {

			System.out.println( "Input an entry:" );
			next = SavitchIn.readLine( );
			toDoList.addElement( next );
                        System.out.println( "Enter More LInes Y/N?" );
			ans = SavitchIn.readLineNonwhiteChar();
			if( (ans == 'n') || (ans == 'N') ) break;
			}

		MyVector.print( toDoList, "The list contains:" );
                Vector vSameAddress = toDoList;
                Vector vClone = (Vector)toDoList.clone();
                toDoList.removeElementAt(0);
                MyVector.print( vSameAddress, "Same address pointer" );
                MyVector.print( vClone, "Clone version" );
		
	} //end main
} //end class
