Skip to content

Latest commit

 

History

History
6 lines (4 loc) · 614 Bytes

File metadata and controls

6 lines (4 loc) · 614 Bytes

Chapter 11

  1. Exercise 11.10 (Implement MyStack using inheritance) In Listing 11.10, MyStack is implemented using composition. Define a new stack class that extends ArrayList. Implement MyStack as the UML diagram provided. Write a test program that prompts the user to enter five strings and displays them in reverse order.

  2. Exercise Casting: Implement this exercise in the package: myPkg.casting. Write a program that creates an ArrayList and adds a Circle object, a Date object, a string, and a Rectangle object to the list, and use a loop to display the radius, the date, and the height from each object.