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
相关文档:
8.9.2 接口
接口(Interface)是一种复合数据类型。
至此,Java语言的所有数据类型介绍完了,下面进行一个简单的总结。Java语言的数据类型分为两大类:基本数据类型和复合数据类型,其中基本数据类型有8种,复合数据类 ......
记得vamcily 曾问我:“为什么获取数组的长度用.length(成员变量的形式),而获取String的长度用.length()(成员方法的形式)?”
我当时一听,觉得问得很有道理。做同样一件事情,为什么采用两种风格迥异的风格呢?况且,Java中的数组其实是完备(full-fledged)的对象,直接暴露成员变量,可能不是一种很OO的风格。 ......
JDK版本:jdk1.6.0_17
a. 下载安装包jdk-6u17-linux-i586-rpm.bin
b. cp jdk-6u17-linux-i586-rpm.bin /usr/local/
c. chmod a+x jdk-6u17-linux-i586-rpm.bin
d. sh jdk-6u17-linux-i586-rpm.bin 接受协议yes,安装完成
e. 设置环境变量
vi /etc/profile
加入下面内容:
#set java environment
JAVA_HOME=/ ......
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 ......
在我机器上安装的是JDK6,下载activeMQ5.3启动时报错,提示jaxb包已经加载2.0版本无法加载2.1版本。
我通过网络搜索了一下发现,jaxb2.0是JDK发布时包含在rt.jar包中的。但是activeMQ5.3却需要2.1版本。这该如何处理?
总不能将rt.jar包解开,将jaxb2.1的类覆盖进去,再重新打包吧。这样太麻烦了。
再次进行网络搜索,发 ......