Using End-of-Line Comments on Right Braces for Readability

As an aid to programming novices, we include an end-of-line comment after a closing brace that ends a method declaration and after a closing brace that ends a class declaration. For example, line 10

} // end method main

indicates the closing brace of method main, and line 11

} // end class Welcome1

indicates the closing brace of class Welcome1. Each comment indicates the method or class that the right brace terminates. We’ll omit such ending comments after this chapter.

Get Java™ How To Program (Early Objects), Tenth 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.