易截截图软件、单文件、免安装、纯绿色、仅160KB

Java如何写注释


整个类文件注释
示例如下
:
/*
 
* @(#)Object.java    
1.61 03/01/23
 
*
 
* Copyright 2003 Sun Microsystems, Inc. All rights reserved.
 
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 
*/
 
package java.lang;
 
注释结构
:
/*
 
* @(#){
类名称
}.java      
{
创建时间
}
 
*
 
* {
某人或某公司具有完全的版权
}
 
* {
使用者必须经过许可
}
 
*/
 
package java.lang;
 
 
2.    
具体类功能注释
示例如下
:
/**
 
* Class <code>Object</code> is the root of the class hierarchy.
 
* Every class has <code>Object</code> as a superclass. All objects,
 
* including arrays, implement the methods of this class.
 
*
 
* @author 
unascribed
 
* @version 1.61, 01/23/03
 
* @see    
java.lang.Class
 
* @since  
JDK1.0
 
*/
public class Object {}
 
注释结构
:
/**
 
*

<code>{
类名称
}</code>{
此类功能描述
}
 
*
 
* @author 
{
作者
}
 
* @version {
版本
,
常用时间代替
}
 
* @see    
java.lang.Class
 
* @since  
JDK{jdk
版本
}
 
*/
public class Object {}
 
3.    
类变量注释
示例如下
:
/** The value is used for character storage. */
 
private char value[];
 
注释结构
:
 
/** {
此值是用来存储
/
记录什么的
}*/
 
private String str ;
 
4.    
类方法注释
示例如下
:
  
 
/**
    
* Returns a new string that is a substring of this string. The
    
* substring begins with the character at the specified index and
    
* extends to the end of this strin


相关文档:

Java的Filter 一:(转载)


 
 
关键字: filter
    过滤器Filter也具有生命周期:init()->doFilter()->destroy(),由部署文件中的filter元素驱动。在servlet2.4中,过滤器同样可以用于请求分派器,但须在web.xml中声明,<dispatcher>INCLUDE或FORWARD或REQUEST或ERROR</dispatcher>该元素位于filter ......

Java编程那些事儿69——抽象类和接口(二)

8.9.2 接口
         接口(Interface)是一种复合数据类型。
         至此,Java语言的所有数据类型介绍完了,下面进行一个简单的总结。Java语言的数据类型分为两大类:基本数据类型和复合数据类型,其中基本数据类型有8种,复合数据类 ......

为什么如此获取Java数组的长度

记得vamcily 曾问我:“为什么获取数组的长度用.length(成员变量的形式),而获取String的长度用.length()(成员方法的形式)?”
我当时一听,觉得问得很有道理。做同样一件事情,为什么采用两种风格迥异的风格呢?况且,Java中的数组其实是完备(full-fledged)的对象,直接暴露成员变量,可能不是一种很OO的风格。 ......

JAVA接口的概念及种类

       一个Java接口(Interface)是一些方法特征的集合,这些方法特征当然来自于具体的方法,但是它们一般都来自于系统中不断出现的方法。一个接口只有方法的特征,而没有方法的实现,因此这些方法在不同的地方被实现时,可以有完全不同的行为。在Java语言的,Java接口还可以定义Public常量。 ......

java 虚拟机运行时数据区域 Runtime Data Areas

The Java virtual machine defines various runtime data areas that are used during execution of a program. Some of these data areas are created on Java virtual machine start-up and are destroyed only when the Java virtual machine exits. Other data areas are per thread. Per-thread data areas are create ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号