// Oefening StackInheritanceTest, D&D 5, blz 1063,..

import be.hogent.h20.H20_StackInheritance;
import be.hogent.h20.H20_EmptyListException;

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

		Boolean bool = Boolean.TRUE;
		Character karakter = new Character('€');
		Integer integer = new Integer(21184);
		String string = "Psst";

		stack.push(bool);
		stack.print();
		stack.push(karakter);
		stack.print();
		stack.push(integer);
		stack.print();
		stack.push(string);
		stack.print();
		
		try {
			Object removedObject = null;
			
			while (true) {
				removedObject = stack.pop();
				System.out.println(removedObject.toString() + " popped (= verwijderd)");
				stack.print();
			}
		}
		catch(H20_EmptyListException x) {
			x.printStackTrace();
		}
	}
	
}
