 |
int
The int primitive represents a 32 bit signed integer. The Integer object is a wrapper class for int.
Rules
- An int can range in value from -231 to 231-1.
- An int can be converted to a long, float or double without loss of information. This is known as a widening primitive conversion.
- An int can be converted to a short, byte or char but only with an explicit cast and loss of information may result. This is known as a narrowing primitive conversion.
- An int cannot be converted to a boolean.
Discussion about int
|