When Java source code is compiled, the result is Java bytecode, stored in with extension ".class". Java bytecode consists of machine-independent instructions that can be interpreted efficiently by the Java runtime system. The Java runtime system operates like a virtual machine. B. Lexical Issues 1. Comments The Java language has three styles of comments: // text All characters from // to the end of the line are ignored. /* text */ All characters from /* to */ are ignored. /** text */ comments are treated specially when they occur immediately before any declaration. They should not appear any other place in the code. These comments indicate that the enclosed text should be included in automatically generated documentation for the declared item. The javadoc program, which comes with the JDK, extracts these special comments, as well as the class or method name that adjoins each such comment. The output of javadoc is an HTML file. The documentation for the Java API () is generated using javadoc. You can insert embedded class documentation tags for javadoc. @see tags are hyperlinked to other documentation, for example, @see classname links to the documentation for classname. Some other tags include @author, @version, @param, @return, @exception, and @deprecated. 2. Identifiers Identifiers must start with a letter, underscore ("_"), or dollar sign ("$"); subsequent characters can also contain digits (0-9). Rather than 8-bit ASCII, Java uses the 16-bit Unicode character set. 3. Keywords The following identifiers are reserved for use as keywords. They cannot be used in any other way. abstract boolean break byte byvalue case catch char class const continue default do double else extends false final finally float for null if implements import instanceof int interface long native new goto package private protected public return short static super switch
When Java source code is compiled, the result is Java bytecode, stored in with extension ".class". Java bytecode consists of machine-independent instructions that can be interpreted efficiently by the Java runtime system. The Java runtime system operates like a virtual machine. B. Lexical Issues 1. Comments The Java language has three styles of comments: // text All characters from // to the end of the line are ignored. /* text */ All characters from /* to */ are ignored. /** text */ comments are treated specially when they occur immediately before any declaration. They should not appear any other place in the code. These comments indicate that the enclosed text should be included in automatically generated documentation for the declared item. The javadoc program, which comes with the JDK, extracts these special comments, as well as the class or method name that adjoins each such comment. The output of javadoc is an HTML file. The documentation for the Java API () is generated using javadoc. You can insert embedded class documentation tags for javadoc. @see tags are hyperlinked to other documentation, for example, @see classname links to the documentation for classname. Some other tags include @author, @version, @param, @return, @exception, and @deprecated. 2. Identifiers Identifiers must start with a letter, underscore ("_"), or dollar sign ("$"); subsequent characters can also contain digits (0-9). Rather than 8-bit ASCII, Java uses the 16-bit Unicode character set. 3. Keywords The following identifiers are reserved for use as keywords. They cannot be used in any other way. abstract boolean break byte byvalue case catch char class const continue default do double else extends false final finally float for goto null if implements import instanceof int interface long native new package private protected public return short static super switch
introduction_java.docx