Home : Course Map : Chapter 2 : Java : Comments
Comments
JavaTech
Course Map
Chapter 2

Introduction
Essentials
Structure

Keywords
Primitive Types
Comments
Literals
Expressions
Operators
Statements
Casts & Mixing
Strings
Console Output 
   Demo
Exercises

    Supplements
Conditional: if-else
Repetitions
Flow Control

Java vs C/C++
JVM Instructions 1

     About JavaTech
     Codes List
     Exercises
     Feedback
     References
     Resources
     Tips
     Topic Index
     Course Guide
     What's New

Java denotes comments in three ways:

  • Double slashes in front of a single line comment:

        int i=5; // Set the integer to 5

  • Matching slash-asterisk (/*) and asterisk-slash (*/) to bracket multi-line comments :

        /*
          Set the integer to 5
        */
        int i=5;


  • Matching slash-double asterisk (/**) & asterisk-slash(*/) for Javadoc automatic hypertext documentation, as in

        /**
          This applet tests graphics.
        */
        public class testApplet extends applet{...

    or

        /**
          * Asterisks inside the comment are ignored by javadoc so they
          * can be used to make nice line markers.
         **/

The SDK tool javadoc uses the latter /** ..*/ comment style when it produces hypertext pages to describe a class. See the Java 2 API Specifications for examples of javadoc output.

Discuss javadoc further in Chapter 5: Java: Javadoc.

References & Web Resources

Latest update: Oct. 14, 2004

            Tech
Arithmetic Ops
Math Class
More on Integers
FP : Overview
FP : Java  
  
Demo 1
More Mix/Cast
  Demo 2
Exercises

           Physics
Differential Eq.
Euler Method
  
Demo 1
Predictor-Corrector
  
Demo 2
Exercises

  Part I Part II Part III
Java Core 1  2  3  4  5  6  7  8  9  10  11  12 13 14 15 16 17
18 19 20
21
22 23 24
Supplements

1  2  3  4  5  6  7  8  9  10  11  12

Tech 1  2  3  4  5  6  7  8  9  10  11  12
Physics 1  2  3  4  5  6  7  8  9  10  11  12

Java is a trademark of Sun Microsystems, Inc.