Decrease various numbers by one.
System. |
The decrementExact() method subtracts 1 from a given integer and throws an exception if an overflow occurs, ensuring accurate results and preventing potential errors.
One of the following:
public |
public |
Parameter |
Description |
x |
Needed: An integer to be decremented from. |
Returns: |
An int or long value representing an integer that is decreased by one. |
Throws: |
ArithmeticException occurs if the decrement operation leads to an overflow. |
Java Version: |
1.8+ |