3. Language Basics

You’ve already learned that objects store their state in fields. However, the Java programming language also uses the term variable as well. The first section of this chapter discusses this relationship, plus variable naming rules and conventions, basic data types (primitive types, character strings, and arrays), default values, and literals.

The second section describes the operators of the Java programming language. It presents the most commonly used operators first and the less common operators last. Each discussion includes code samples that you can compile and run.

Operators may be used in building expressions, which compute ...

Get The Java® Tutorial: A Short Course on the Basics, Fifth 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.