JAVA编程规范V1.1(7)
时间:2025-07-13
时间:2025-07-13
JAVA编程规范V1.1
1.1.3 注释
注释方法
Try to use the // commenting style for a majority of your comments the /** */ commenting style is for all of your javadoc comments
the /* */ commenting style only for temporarily commenting out blocks of code
JAVA DOC
明显的方法可以不加注释,如: public static void main( String[] args ) public int getX()
public void setX( int newX )
超过一行的Doc注释
/** Set how much to grow when growth is needed. <p>
Smaller values will usually save memory, but frequent reallocation may take a lot of time. <p>
@param howMuch The number of extra ints to allocate when memory reallocation is required. Values must be greater than zero. <p> */
public void setExtra( int howMuch )
{
JAVA CLASS注释
Class摘要描述 详细描述
使用Class的示例代码 作者,使用 @author 标签 如:
/** A vector class optimized for working with ints. <p>
Like the Vector object, except rather than tracking a dynamic array of pointers to different objects, this is simply a dynamic array of ints. The advantage is speed and memory savings.<p>
上一篇:QTZ80A塔吊使用说明书
下一篇:仪器室借用登记表