Recall that Java has expressions to represent math and other computations. Expressions may use operators, which are evaluated according to rules of precedence. Every expression produces a value of a given type.
Type | Description | Example | Result |
---|---|---|---|
int |
integers (up to 231 - 1) | 3 + 4 * 5 |
23 |
double |
real numbers (up to 10308) | 3.0 / 2.0 + 4.1 |
5.6 |
String |
text characters | "hi" + (1 + 1) + "u" |
"hi2u" |