
/**
 * demonstration of Polymorphism
 */

public class Chapter13n2
    {
    public static void main(String[] args)
	{
	Reservation[] collection = new Reservation[4] ;

	BasicReservation br = new BasicReservation() ;
	br.set(12, 23) ;
	collection[0] = br ;

	NiceReservation nr1 = new NiceReservation() ;
	nr1.set(34, 45, NiceReservation.AISLE, NiceReservation.GREEN) ;
	collection[1] = nr1 ;

	NiceReservation nr2 = new NiceReservation() ;
	nr2.set(45, 56, NiceReservation.WINDOW, NiceReservation.RED) ;
	collection[2] = nr2 ;

	PoshReservation pr = new PoshReservation() ;
	pr.set(67, 78, NiceReservation.AISLE,
		 NiceReservation.WHITE, "Motherwell") ;
	collection[3] = pr ;

	for (int i = 0 ; i < 4 ; i++)
	    {
	    collection[i].print() ;
	    System.out.println() ;
	    }
	} // end of main method
    } // end of class Chapter13n2

