📄 docbox.java
字号:
/** This is a simple class used to demonstrate various javadoc tags.
@author Jeremy Pfeifer
@version 1.0 */
public class DocBox
{
/** The height of the box. */
private int height;
/** The depth of the box. */
private int depth;
/** The width of the box. */
private int width;
/** A simple constructor that simply initializes the instance
variables to the values passed in.
@param d The depth of the box.
@param h The height of the box.
@param w The width of the box. */
public DocBox(int h, int w, int d)
{
height = h;
width = w;
depth = d;
}
/** A method used to give a string representation of this class.
@see java.lang.String
@return A string containing the dimensions of the box in the order
height, width, and depth. */
public String toString()
{
String temp = "Dimensions are: " + height + " x " + width + " x " + depth;
return temp;
}
/** The starting point of the program. It creates a single instance of this class
and then displays the instance to the console.
@param args An array of command-line arguments. */
public static void main(String[] args)
{
DocBox db = new DocBox(10, 20, 30);
System.out.println(db);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -