Understanding the effect of assignment and mathematical operators on primitives
and objects

Understanding the operation of bitwise and logical operators in expressions

Understanding the implications of the various forms of the AND and OR logical
operators

Understanding the correct use of the == comparison operator with primitives
and objects

Predicting the operation of the equals method with combinations of various
objects

Declaring, constructing, and initializing arrays of any type

Introduction

Java uses literals and operators in a style that will be very familiar to all
C programmers. In this chapter, we review the way Java uses literals to
initialize primitive variables, create objects, and pass values to methods. We
then review all of the Java operators used in expressions with both primitives
and objects. You should not assume that the behavior of operators is the same in
Java as in C. Pay particular attention to the difference between the ==
operator (double equals sign) and the equals method; this seems to
confuse many programmers.