White Space

The term white space refers to one or more consecutive space characters, Tab characters, or line breaks. All white space is considered the same. In other words, a single space is treated the same as a Tab or line break or any combination of spaces, Tabs, and line breaks.

tip.eps Using white space liberally in your programs is a good idea. In particular, you should routinely use line breaks to place each statement on a separate line, and use Tabs to line up elements that belong together. The compiler ignores the extra white space, so it doesn’t affect the bytecode that’s created for your program. As a result, using extra white space in your program doesn’t affect your program’s performance in any way, but it does make the program’s source code easier to read.

Get Java For Dummies Quick Reference 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.