graphics.java

来自「大学java作业源程序」· Java 代码 · 共 36 行

JAVA
36
字号
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 + =
减小字号Ctrl + -
显示快捷键?