next up previous
Next: 1.3 Java Data Types Up: 1.2 Java Mechanics Previous: 1.2.8 Defining Static Methods

1.2.9 Capitalization and Commenting Conventions

By convention, Java programs are written entirely in lower case characters with three exceptions.

These conventions are not enforced by Java compilers, but it is considered bad style to violate them. A related convention is to never use the special character $ in a name; this character is reserved for the use of the Java compiler. Unfortunately, most Java compilers do not enforce this convention.

Java relies on commenting conventions similar to those in C++. A comment that is confined to a single line begins with the character sequence // and ends at the end of the line. Longer comments must be enclosed between the opening ``bracket'' /* and ``closing'' bracket star/. Examples of both form of comments appear in Section 1.5.


Finger Exercise: add both forms of comment to the Conversions class from the preceding exercise.


next up previous
Next: 1.3 Java Data Types Up: 1.2 Java Mechanics Previous: 1.2.8 Defining Static Methods
Corky Cartwright
2000-01-07