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 ...

Get Special Edition Using Java 2 Standard Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.