Java – ArithmeticException
ArithmeticException: Thrown when an illegal arithmetic operation, such as division by zero, is performed.
Example:
int a = 10;
int b = 0;
try {
int result = a / b;
} catch (ArithmeticException e) {
System.out.println("Caught ArithmeticException: " + e.getMessage());
}
No images available.