Concept:
ArithmeticException is an unchecked exception in Java. Usually, one would come across java. lang. ArithmeticException: Divide ( / ) by zero which occurs when an attempt is made to divide two numbers and the number in the denominator is zero
Code snippet:
int a = 0;
int b = 10/a // divide by zero exception.
Additional Information
- A null pointer exception is thrown when an application attempts to use null in a case where an object is required. These include: Calling the instance method of a null object. Accessing or modifying the field of a null object.
- Signals that a method has been invoked at an illegal or inappropriate time. In other words, the Java environment or Java application is not in an appropriate state for the requested operation
- The array index out of bounds error is a special case of the buffer overflow error. It occurs when the index used to address array items exceeds the allowed value. It's the area outside the array bounds which is being addressed, that's why this situation is considered a case of undefined behavior..
