how do we know at runtime int value will be gretae then its range .
do we need to explicitky check by using if condition ...
Unfortunately,
Java doesn't throw exceptions for overflow and underflow conditions. It just wraps around. So, the easiest way to tell that it happened, is if the sign changed (when it obviously should not have).
Henry