📄 graphics.java
字号:
package problem_8;
//Graphics.java
//图像类,抽象类
public abstract class Graphics {
private String color; //颜色
private double weight; //重量
public Graphics(String color, double weight){
this.color = color;
this.weight = weight;
}
//返回颜色
public String getColor(){
return color;
}
//返回重量
public double getWeight(){
return weight;
}
//设置颜色
public void setColor(String color){
this.color = color;
}
//设置重量
public void setWeight(double weight){
this.weight = weight;
}
public abstract double calculatePerimeter(); //抽象计算周长函数
public abstract double calculateArea(); //抽象计算面积函数
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -