package b; public class Rect { Double width; Double height; public Double getWidth() { return width; } public void setWidth(Double width) { this.width = width; } public Double getHeight() { return height; } public void setHeight(Double height) { this.height = height; } public Rect(Double width, Double height) { super(); this.wi
通过继承Rect类编写一个具有确定位置的矩形类PlainRect,其确定位置用 矩形的左上角坐标来标识,包含: 添加两个属性:矩形左上角坐标startX和startY。 两个构造方法: 带4个参数的构...
最新推荐文章于 2023-05-24 21:08:15 发布
本文介绍如何通过继承Rect类创建PlainRect,该类定义了矩形的左上角坐标作为位置标识。内容包括添加startX和startY属性,并提供了带四个参数的构造方法来初始化矩形的位置。
摘要由CSDN通过智能技术生成