geometricobject.java
来自「java的小程序」· Java 代码 · 共 34 行
JAVA
34 行
public abstract class GeometricObject
{
protected String color;
protected double weight;
protected GeometricObject()
{
color = "white";
weight = 1.0;
}
protected GeometricObject(String color, double weight)
{
this.color = color;
this.weight = weight;
}
public String getColor()
{
return color;
}
public void setColor(String color)
{
this.color = color;
}
public double getWeight()
{
return weight;
}
public void setWeight(double weight)
{
this.weight = weight;
}
public abstract double findArea();
public abstract double findPerimeter();
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?