package threehundemo;
abstract class shape{
public String getName(){
return this.getClass(). ();
}
public abstract double getArea();
}
class Circle extends shape{
private double radious;
public Circle(double radious) {
this.radious = radious;
}
@Override
public double getArea() {
// TODO 自动生成的方法存根
return Math.PI*Math.pow(radious, 2);
}
}
class Rectangle extends shape{
public Rectangle(double length, double width) {
super();
this.length = length;
this.width = width;
}
private double length;
private double width;
public double getLength() {
return length;
}
public void setLength(double length) {
abstract class shape{
public String getName(){
return this.getClass(). ();
}
public abstract double getArea();
}
class Circle extends shape{
private double radious;
public Circle(double radious) {
this.radious = radious;
}
@Override
public double getArea() {
// TODO 自动生成的方法存根
return Math.PI*Math.pow(radious, 2);
}
}
class Rectangle extends shape{
public Rectangle(double length, double width) {
super();
this.length = length;
this.width = width;
}
private double length;
private double width;
public double getLength() {
return length;
}
public void setLength(double length) {