Asked by nina
                List all overloading methods (including constructors) in this coding..
public class Circle {
private double radius;
private String colour;
    
public Circle()
{
radius = 0;
colour = "";
}
public Circle (double r)
{
radius = r;
}
   
double getRadius()
{
return radius;
}
   
double getArea()
{
return Math.PI * radius * radius;
}
   
public String toString()
{
return "Aread of a circle with radius " + radius + " is " + getArea();
}
}
public class Cylinder extends Circle {
private double height;
   
public Cylinder ()
{
super();
height = 0.0;
}
public Cylinder(double height) {
super();
this.height = height;
}
   
public Cylinder(double radius, double height) {
super(radius);
this.height = height;
}
   
public double getHeight() {
return height;
}
  
public double getVolume() {
return super.getArea()*height;
}
}
            
            
        public class Circle {
private double radius;
private String colour;
public Circle()
{
radius = 0;
colour = "";
}
public Circle (double r)
{
radius = r;
}
double getRadius()
{
return radius;
}
double getArea()
{
return Math.PI * radius * radius;
}
public String toString()
{
return "Aread of a circle with radius " + radius + " is " + getArea();
}
}
public class Cylinder extends Circle {
private double height;
public Cylinder ()
{
super();
height = 0.0;
}
public Cylinder(double height) {
super();
this.height = height;
}
public Cylinder(double radius, double height) {
super(radius);
this.height = height;
}
public double getHeight() {
return height;
}
public double getVolume() {
return super.getArea()*height;
}
}
Answers
                    Answered by
            UUM
            
    HAHA NOOB.
    
                                                    There are no AI answers yet. The ability to request AI answers is coming soon!
                                            
                Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.