// This is for Circle.Java
Code:
package Circle;
public class Circle {
private double radius;
public Circle()
{
radius = 2.0;
}
public double getRadius()
{
return radius;
}
public double getArea()
{
return radius*radius*Math.PI;
}
public void printMe()
{
System.out.println("ID is 2015");
}
}
//This is for Cylinder.Java
Code:
package Circle;
public class Cylinder extends Circle {
private double height;
public Cylinder()
{
super();
height = 2.5;
}
public double getHeight()
{
return height;
}
public double getVolume()
{
return height*getArea();
}
@Override
public void printMe()
{
System.out.println("Color is blue");
}
void print()
{
.printMe();
.printMe();
}
public static void main(String[] args){
Cylinder cy1 = new Cylinder();
System.out.println("Radius is " + cy1.getRadius()+" Height is " + cy1.getHeight()+ " Base area is " + cy1.getArea()+ " Volume is " + cy1.getVolume());
cy1.print();
}
}
My is being underlined in both file.
In my Cylinder.java , I do not understand the part where it says
Code:
void print()
{
.printMe(); //I am suppose to type something in front but i don't know what I'm suppose to
.printMe(); //I am suppose to type something in front but i don't know what I'm suppose to
}
Help would be appreciated, did I miss out something in some part of my code>