Unformatted text preview: 2. Create a class named Square that contains data fields for height, width and surfaceArea, and a method named computeSurfaceArea(). Create a child class named Cube. Cube contains an additional data field named depth and a computeSurfaceArea() method that overrides the parent method. Write an app that instantiates objects of both classes....
View Full Document
- Spring '08
- Inheritance, grade level, data fields, computeSurfaceArea, additional data field, level field.