第十一次实验课代码

添加C08~C011
This commit is contained in:
2025-11-20 17:01:56 +08:00
parent 1c869f816f
commit 9930f2421a
67 changed files with 1137 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
package shape;
import java.awt.*;
public class Shape {
public abstract class Shape {
protected Color color;
protected int x,y;
@@ -11,9 +11,7 @@ public class Shape {
public Color getColor() {
return color;
}
public double getArea(){
return x*y;
}
public abstract double getArea();
public void setX(int x){
this.x=x;
@@ -29,9 +27,7 @@ public class Shape {
return y;
}
public double getPerimeter(){
return x*y;
}
public abstract double getPerimeter();
public void move(int dx,int dy){
x += dx;