Design a class named Cylinder:1. The Cylinder class is a subclass of Circle,(you should not write this class ,it is the same as question 8),the Cylinder Class contains:2. A double data fields named h represents the high of Cylinder;3. A non-arg constructor that initalizes r with 1,h with 2;4. A constructor with 2 aguments that initalizes r and h with the arguments;5. A method named getVolume() that returns the volume of the Cylinder.
发布时间:2024-05-23 21:46:48