package shape;
abstract public class shape {
abstract double getArea();
}
package shape;
public class circle extends shape{
double r=0;
public circle(double r){
this.r=r;
}
double getArea(){
double s=0;
return s=rrMath.PI;
}
}
package shape;
public class rectangle extends shape {
double x=0,y=0;
rectangle(double x,double y){
this.x=x;
this.y=y;
}
double getArea()
{
double s=0;
return s=x*y;
}
}
package shape;
public class triangle extends shape {
double a=0,b=0,c=0;
triangle(double a,double b,double c)
{
this.a=a;
this.b=b;
this.c=c;
}
double getArea()
{
double s=0;
double p=0;
p=(a+b+c)/2;
return s=Math.sqrt(p*(p-a)*(p-b)*(p-c));
}