public Cone( double radius, double height )
Creates a new instance of a Cone object with the specified height and radius
You could have picked other names for the parameters.
But they should be of type double.
Cone classHere is more of our design:
ConeA class that represents a right circular cone
Variables
private double height; // height of the coneprivate double radius; // radius of the circular baseConstructor
public Cone( double radius, double height )
Creates a new instance of a Cone object with the specified height and radiusMethods
- . . . .
- . . . .
- . . . .
- . . . .
Constructors are usually made public.
Decide on some methods that Cone objects will have.