Common Java exceptions and errors at compile-time and runtime, with clear explanations and fixes.
Attempting to use a reference that points to null.
Accessing an array with an index that is out of its valid range.
Illegal cast between incompatible reference types at runtime.
Infinite recursion exhausts the JVM call stack.
Parsing a string that cannot be converted to the expected numeric type.
Modifying a collection structure while iterating over it.
JVM runs out of heap memory allocated for object instantiation.
Attempting to modify an unmodifiable or read-only Collection structure.
A method has been passed an illegal or inappropriate argument value.
The JVM cannot find a compiled class file at runtime that was present during compilation.