javadocdemo.java

来自「卡内基梅陇大学的网上教程 ssd3第一单元的源码」· Java 代码 · 共 68 行

JAVA
68
字号

/**
 * <p>This class store the value of two integers.</p>
 * <p>This class is written for the purpose of demonstrating Javadoc
 * comments. Javadoc comments for classes can be broken into two
 * parts: a description part and a tags part.  This is the
 * description part.  The parts should be separated by one empty
 * comment line.</p>
 * <p>Also, there should be no lines between the end of the Javadoc
 * comment and the beginning of the entity it describes.</p>
 *
 * @author  Lily Hou
 * @author  Sean Bufano
 * @version  1.0.0
 */
package unitOne;

public class JavaDocDemo {

	private int  first;
	private int  second;

	/**
	 * Initializes both integers to <code>0</code>.
	 */
	public  JavaDocDemo()  {

		this.first = 0;
		this.second = 0;
	}

	/**
	 * Initializes both integers to arguments.
	 *
	 * @param initialFirst  value to which field <code>first</code>
	 *        is initialized
	 * @param initialSecond  value to which field <code>second</code>
	 *        is initialized
	 */
	public  JavaDocDemo(int  initialFirst, int  initialSecond)  {

		this.first = initialFirst;
		this.second = initialSecond;
	}

	/**
	 * Computes the sum of the two integers.
	 *
	 * @return  the sum of the two integers
	 */
	public int  sum()  {

		return  this.first + this.second;
	}

	/**
	 * Increments the field <code>first</code> by the argument.
	 *
	 * @param value  the value by which field <code>first</code> will
	 *        be incremented
	 */
	public void  addToFirst(int  value)  {

		this.first += value;
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?