Exercise JAVA
Exercise JAVA
1, 2, 3
Exercise 1: The Circle and Cylinder Classes
The class Cylinder inherits all the member variables (radius and color) and methods
(getRadius(), getArea(), among others) from its superclass Circle. It further defines
a variable called height, two public methods - getHeight() and getVolume() and its
own constructors
Circle.java (Re-produced)
// Constructors
Cylinder.java
/**
* A Cylinder is a Circle plus a height.
*/
public class Cylinder extends Circle {
// private instance variable
// Constructors