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种,复合数据类 ......
一个Java接口(Interface)是一些方法特征的集合,这些方法特征当然来自于具体的方法,但是它们一般都来自于系统中不断出现的方法。一个接口只有方法的特征,而没有方法的实现,因此这些方法在不同的地方被实现时,可以有完全不同的行为。在Java语言的,Java接口还可以定义Public常量。 ......
选择题
3阅读一下程序:
Boolean a=false;
Boolean b=true;
Boolean c=(a&b)&&(!b);
Int result=b==false?1:2;
这段程序执行完后,c与result的值是(D)。
A c=false; result=1; B. c=true;result=2;
C.c=true;result=1 D. c=false; result=2
6.下述声明中哪种可防 ......
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 ......