?? rectangle.java
字號(hào):
public class Rectangle extends GeometricObject
{
protected double width;
protected double height;
public Rectangle()
{
this(1.0, 1.0, "white", 1.0);
}
public Rectangle(double width, double height)
{
this.width = width;
this.height = height;
}
public Rectangle(double width, double height,
String color, double weight)
{
super(color, weight);
this.width = width;
this.height = 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 double findArea()
{
return width*height;
}
public double findPerimeter()
{
return 2*(width + height);
}
public boolean equals(Rectangle rectangle)
{
return (width == rectangle.getWidth()) &&
(height == rectangle.getHeight());
}
public String toString()
{
return "Rectangle ";
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -