Non-Token Input Elements

Now that you've seen the various types of tokens in Java, let's complete the discussion with a look at the only input elements in your source code that aren't classified as tokens. As was stated when tokens were defined previously, whitespace and comments are the two non-token element types.

Whitespace

Of some importance to most languages is the use of whitespace. Whitespace is any character that is used just to separate text—a space, tab, form feed, line feed, or carriage return.

In Java, whitespace can be inserted almost anywhere within an application's source code without affecting the meaning of the code to the compiler. The only place that whitespace cannot be used is within an identifier, such as a variable or class ...

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.