📄 rectangle.java
字号:
/* * Rectangle - a Shape - defines height and width to specify rectangle */public class Rectangle extends Shape{ // Attributes private double height; private double width; // Constructors public Rectangle() { super(); height = 0.0; width = 0.0; } public Rectangle(Point org, double h, double w) { super(org); height = h; width = w; } // Methods public double area() { return height * width; } public double perimeter() { return 2 * (height + width); } public double getH() { return height; } public double getW() { return width; } public void setHW(double h, double w) { height = h; width = w; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -