- Integer types:
byte (8) short (16) int (32) long (64)
Suggestion: stick to int
literals of integer types are written in the usual way as
optionallyl signed strings of digits such as -356.
- Floating types:
float (32), exponent +-38 or so, mantissa 7 digits or so
double <64), exponent +-238 or so, mantissa 15 digits or so
Problem: not currently IEEE 754 compliant
Suggestion: stick to double
literals of floating types are written in substantially the same
ways as in other programming languages, appearance of decimal point being
essential, appearance of e for exponent being optional.
Examples: 0.0, 29e-3, 23.42.
- some other types:
char - character in unicode (16) - not ascii (8)
boolean - values are just "true" and "false"
Suggestion: use boolean as appropriate, but almost
never use the literals true and false. When you find yourself
using the literal values, there is usually a better way.
- Wrappers: All these types may be capitalized. Then they become
true objects consistent with the construction of complex objects in
java. Suggestion: Let's use the object form except where we find
some good reason not to.