I have an issue regarding the super keyword in java. Follow the example below:
public class Circle {
private double radius;
private double area;
public void setRadius(double radius){
this.radius = 1;
}
public double getRadius(){
return this.radius;
}
public void setArea(double radius){
this.area = area;
}
public double getArea(){
return this.area = Math.PI * radius * radius;
}
}
public class Cylinder extends Circle {
private double height;
public Cylinder(){
super();
height = 1;
}
public Cylinder(double height){
super();
this.height = height;
}
public Cylinder(double radius, double height){
super();
this.height = height;
public double getHeight(){
return height;
}
}
public double getVolume(){
return getArea()*height;
}
}
My point is that, when I use super() in the subclass, how java will know which constructor to call in my subclass ? Since in my superclass, I have two constructors with no arguments; public double getRadius() and public double getArea()