我的这个作业合格吗?求评价!
package tuxing2;
public abstract class tuxing {
static int a = 4;
static double π = 3.14;
static int b = 5;
public abstract void Area();//面积
public abstract void Perimeter();//周长
}
-----------------------------------------------------------------------------------------------------------------------------------------------
package tuxing2;
public class Round extends tuxing {
@Override
public void Area() {//圆形的面积
// TODO Auto-generated method stub
System.out.println("圆形的面积= "+π*a*a);
}
@Override
public void Perimeter() {//圆形的周长
// TODO Auto-generated method stub
System.out.println("圆形的周长= "+2*π*a);
}
}
-----------------------------------------------------------------------------------------------------------------------------------------------
package tuxing2;
public class Rectangle extends tuxing {
@Override
public void Area() {//矩形的面积
// TODO Auto-generated method stub
System.out.println("矩形的面积= "+a*b);
}
@Override
public void Perimeter() {//矩形的周长
// TODO Auto-generated method stub
System.out.println("矩形的周长= "+(a+a+b+b));
}
}
-----------------------------------------------------------------------------------------------------------------------------------------------
package tuxing2;
public class Test {
public static void main(String[] args) {
// TODO Auto-generated method stub
tuxing TX1 = new Round();
TX1.Area();
TX1.Perimeter();
tuxing TX2 = new Rectangle();
TX2.Area();
TX2.Perimeter();
}
}