Exercises 2901
Exercises 2901
1 Date:
Name: Period:
1. What does ADT stand for?
4. What is a variable?
8. What is an ADT?
9. Is the implementation of an ADT in a specific programming language part of the ADT definition?
19. In the world of OOP, the initializing of the stack is performed by the _________________________.
21. Compare and contrast the peek and pop operations of a stack?
22. If information is pushed onto the stack in ascending order, how will it be popped?
23. Java’s Stack class has the standard methods of push, pop, peek, and isEmpty. Due to inheritance from
other classes in the Java hierarchy, there are other methods available. Are you allowed to use any of these additional
methods on the AP Exam? (or on any Stack assignment in this class?)
24. Can generics be used with the Stack class like it is used with ArrayList?
25. Look at program Java2903.java. Which statement prevents a pop from an empty stack?
26. When working with a stack, why is a temporary stack frequently necessary?
27. You have seen examples of autoboxing used with ArrayList. What about stacks?
Look at program Java2906.java. Would autoboxing work here as well?
8/15/2007