Jun 30 2010
Learn Java Programming: Range of Numeric Values
- 1 Comment
How to Learn Java Language Tips: Range of Numeric Values
All numeric types have a range of valid values. This range is given by the constants named MAX_VALUE and MIN_VALUE, which are defined in each numeric wrapper class.
The arithmetic operators are overloaded, meaning that the operation of an operator varies depending on the type of its operands. Floating-point arithmetic is performed if any operand of an operator is of floating-point type, otherwise, integer arithmetic is performed.
Values that are out-of-range or are results of invalid expressions, are handled differently depending on whether integer or floating-point arithmetic is performed.
[...] form a new value by shifting bits either left or right a specified number of times in a given integral value. The number of shifts (also called the shift distance) is given by the right-hand operand, and the [...]