📄 betterbasicbox.java
字号:
/** A class that extends BasicBox to include a version of equals
that is defined for a parameter of type Object. */
public class BetterBasicBox extends BasicBox
{
/** Constructor for a box. */
public BetterBasicBox(int l, int w, int h)
{
super(l, w, h);
}
/** Does this box have equal variable values as object other? */
public boolean equals(Object other)
{
BetterBasicBox otherBox = (BetterBasicBox) other;
return length == otherBox.length & width == otherBox.width & height == otherBox.height;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -