📄 verybasicbox.java
字号:
/** A simple box class with variables for the length, width, and height,
and a method to compute its volume. */
public class VeryBasicBox
{
/** Instance variables of the class. */
int length, width, height;
/** Method for returning the volume of the box. */
public int volume()
{
int vol;
vol = length * width * height;
return vol;
}
/** Constructor to create an object and initialize its variables. */
public VeryBasicBox(int l, int w, int h)
{
length = l;
width = w;
height = h;
}
/** Does this box have equal variable values as box other? */
public boolean equals(VeryBasicBox other)
{
return (length==other.length) && (width==other.width) && (height==other.height);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -