I cant Understand whats the problem with my code I cant figure it out please help me :
System.out.println("Enter the Radius of the circle: ");
double radius = input.nextDouble();
ShapeCircle AndP = new ShapeCircle();
System.out.println(AndP.Acircle(radius));
System.out.println(AndP.Pcircle(radius));
input.close();
I wanted to programme it with abstract
abstract class ShapeCircle{
public double Acircle(double radius){
double Ans;
return Ans = Math.PI * (radius * radius);
}
public abstract double Pcircle(double radius);
}
but I can't understand whats the problem,this is my other class :
class shapePcircle extends ShapeCircle{
public double Pcircle(double radius){
double Ans;
return Ans = 2 * Math.PI * radius;
}
}
the problem is here
ShapeCircle AndP = new ShapeCircle();
Cannot instantiate the type I don't know why