0% found this document useful (0 votes)
16 views2 pages

Exercises 2901

This document contains a series of exercises related to Abstract Data Types (ADTs) and data structures in Java, specifically focusing on stacks. It includes questions about definitions, operations, and concepts such as information hiding, generics, and autoboxing. The exercises aim to assess understanding of key programming concepts relevant to the AP Computer Science exam.

Uploaded by

emailao031
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views2 pages

Exercises 2901

This document contains a series of exercises related to Abstract Data Types (ADTs) and data structures in Java, specifically focusing on stacks. It includes questions about definitions, operations, and concepts such as information hiding, generics, and autoboxing. The exercises aim to assess understanding of key programming concepts relevant to the AP Computer Science exam.

Uploaded by

emailao031
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

APCS-AB Exposure Java Exercises 29.

1 Date:
Name: Period:
1. What does ADT stand for?

2. Are ADTs language dependent?

3. What is a data type?

4. What is a variable?

5. What is a primitive (or simple) data type?

6. What 3 simple data types are tested on the AP Exam?

7. What is a data structure?

8. What is an ADT?

9. Is the implementation of an ADT in a specific programming language part of the ADT definition?

10. What is an object?

11. What is information hiding?

12. List 3 reasons for information hiding.

13. What is a stack?

14. What does LIFO stand for?

15. Explain a stack's push operation.


8/15/2007
16. Explain a stack's pop operation.

17. Explain a stack's clearStack operation.

18. What is another popular name for clearStack.

19. In the world of OOP, the initializing of the stack is performed by the _________________________.

20. Explain a stack's isEmpty operation.

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?

28. Look at program Java2907.java.


Why is it not necessary to use typecasting when popping objects of the Person class?

29. Look at program Java2908.java.


How is it possible to store an int, a double, a String, and a Person object all in the same stack?

8/15/2007

You might also like