// StackInheritanceTest.java
// Class StackInheritanceTest.
package chapter35;

public class StackInheritanceTest
{
    public static void main( String args[] )
    {
        StackInheritance stack = new StackInheritance();

        // Push integers onto the stack using push method
        stack.push( -1 );
        stack.print();
        stack.push( 0 );
        stack.print();
        stack.push( 1 );
        stack.print();
        stack.push( 5 );
        stack.print();

       // remove items from stack
        Object removedObject = null;

        // Pop the objects from the stack using pop method
        removedObject = stack.pop(); // use pop method
        System.out.printf( "%s popped\n", removedObject );
        stack.print();

        // remove items from stack
         removedObject = stack.pop(); // use pop method
         System.out.printf( "%s popped\n", removedObject );
         stack.print();

    } // end main
} // end class StackInheritanceTest
