while this invocation returns false:
sameArgs(3, new Integer(3))
An implementation of the virtual machine may choose to expand on these types and ranges, and is free to
determine when instances of the wrapper classes are first created: They could be created eagerly and all stored
in a lookup table, or they could be created as needed.
Dare to be naïve.
R. Buckminster Fuller
Chapter 9. Operators and Expressions
Work is of two kinds: first, altering the position of matter at or near the earth's surface relative
to other matter; second, telling other people to do so.
Bertrand Russell
This chapter teaches you about the fundamental computational building blocks of the programming
languagenamely, operators and expressions. You have already seen a lot of code and have gained familiarity
with its components. This chapter describes these basic elements in detail.
Each operator is described in terms of its basic operation, upon operands of the base expected typesuch as a
numeric primitive type or a reference type. The actual evaluation of an expression in a program may involve
type conversions as described in Section 9.4 on page 216.
9.1. Arithmetic Operations
There are several binary arithmetic operators that operate on any of the primitive numerical types:
+ addition
- subtraction
* multiplication
/ division
% remainder
You can also use unary - for negation. The sign of a number can be inverted with code like this:
val = -val;
For completeness there is also a unary +, as in +2.0.