O'Reilly logo

Special Edition Using Java 2 Standard Edition by Geoff Friesen, Chuck Cavaness, Brian Keeton

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

Understanding HelloWorld

The result you get from running HelloWorld might not seem very interesting, but then it's a simple program. There is a good bit to be learned from the code, however. After you understand each piece, you'll be much closer to being able to write any program you want.

Comments

The HelloWorld source code begins with a comment that describes the purpose of the program:

/**
* My first program demonstrates displaying
* a string on the screen
*/

Given enough time, another programmer reading your code can usually understand what it does, but comments allow you to explain why you implemented a program in a certain way, or even how you intend for it to be used. Java supports several styles of comments that are described in Chapter ...

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