O'Reilly logo

Real World XML by Steven Holzner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Commenting Your Code

As with JavaScript, you can comment your Java code. Comments serve the same purpose here as they do in XML and JavaScript: They hold descriptive code that explains what's going on in your code. There are two ways to insert comments in a Java program. The first way is to surround comments, especially multiline comments, with the characters /* and */, like this:

					/* This application is designed to display
					the message "Welcome to Java" on the console
					*/

public class ch10_01
{
    public static void main(String[] args)
    {
        System.out.println("Welcome to Java");
    }
}

As with any type of comment, the Java compiler ignores the text in the comment—that is, any text between the /* and */ markers.

As with JavaScript, Java supports a one-line ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required