You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
378 B
19 lines
378 B
package com.example.shape;
|
|
|
|
/**
|
|
* 图形抽象类
|
|
* 包含抽象方法getArea(),用于计算图形面积
|
|
* 包含抽象方法draw(),用于绘制图形
|
|
*/
|
|
public abstract class Shape {
|
|
/**
|
|
* 计算图形面积
|
|
* @return 图形的面积
|
|
*/
|
|
public abstract double getArea();
|
|
|
|
/**
|
|
* 绘制图形
|
|
*/
|
|
public abstract void draw();
|
|
}
|