0
Explore
0

Complete List of Unchecked Exceptions in Java

Updated on July 29, 2025

In Java, unchecked exceptions are the exceptions that occur during runtime and are not checked by the compiler. These exceptions are subclasses of RuntimeException, and the Java compiler doesn’t force you to catch or declare them using throws.

Unchecked exceptions typically occur due to programming errors like bad logic, null access, invalid type casting, or improper use of collections. While they can crash your application if not handled properly, understanding them helps you write more robust and bug-free code.

In this guide, we’ve organized all the major unchecked exceptions in Java into clear categories—so you can quickly learn, recognize, and handle them effectively.

Unchecked Exceptions in Java – Complete List with Descriptions

ExceptionDescription
ArithmeticExceptionDivision by zero or other invalid arithmetic operation
NumberFormatExceptionParsing a string into a number with invalid format
IllegalFormatException (and subtypes)Format string issues during String.format()

Examples:

int a = 10 / 0; // ArithmeticException
Integer.parseInt("abc"); // NumberFormatException
System.out.printf("%d", "hello"); // IllegalFormatConversionException
ExceptionDescription
ArrayIndexOutOfBoundsExceptionAccessing an array with an invalid index
NegativeArraySizeExceptionCreating an array with a negative size
ArrayStoreExceptionStoring wrong type into an array
IndexOutOfBoundsExceptionSuperclass for array and list indexing issues
ConcurrentModificationExceptionModifying a collection while iterating
NoSuchElementExceptionCalling next() when no element is present
EmptyStackExceptionAccessing an empty stack

Examples:

int[] a = new int[3];
a[5] = 10; // ArrayIndexOutOfBoundsException

ArrayList<String> list = new ArrayList<>();
list.get(1); // IndexOutOfBoundsException

3. 🧵 Threading and Synchronization Exceptions

ExceptionDescription
IllegalThreadStateExceptionThread is not in the correct state
IllegalMonitorStateExceptionUsing wait/notify outside synchronized context

Examples:

Thread t = new Thread();
t.start();
t.start(); // IllegalThreadStateException
ExceptionDescription
NullPointerExceptionAccessing method or field on a null object
ClassCastExceptionInvalid type casting
EnumConstantNotPresentExceptionEnum constant not found
TypeNotPresentExceptionType info missing during reflection or generics

Examples:

String s = null;
s.length(); // NullPointerException

Object obj = "test";
Integer i = (Integer) obj; // ClassCastException

5. 🛠️ Illegal Usage or Configuration Exceptions

ExceptionDescription
IllegalArgumentExceptionMethod gets an inappropriate argument
IllegalStateExceptionObject is not in correct state for requested operation
UnsupportedOperationExceptionMethod is not supported by object
SecurityExceptionSecurity manager violation

Examples:

Thread t = new Thread();
t.setPriority(11); // IllegalArgumentException

List<String> list = Collections.unmodifiableList(new ArrayList<>());
list.add("item"); // UnsupportedOperationException

6. 🎛️ Formatting and Input Exceptions

ExceptionDescription
InputMismatchExceptionScanner gets input that doesn’t match expected type
MissingFormatArgumentExceptionFormat string argument is missing
DuplicateFormatFlagsExceptionDuplicate format flags in string formatting
MissingFormatWidthExceptionFormat specifier width is missing
FormatFlagsConversionMismatchExceptionIncompatible format flags
ExceptionDescription
MissingResourceExceptionResource bundle key or file not found
UncheckedIOExceptionWrapper for IOException as unchecked
AnnotationTypeMismatchExceptionAnnotation has incompatible value
IllegalComponentStateExceptionGUI component not ready for interaction

🔄 Summary Table by Category

CategoryExample Exceptions
Arithmetic / NumbersArithmeticException, NumberFormatException
Arrays / CollectionsArrayIndexOutOfBoundsException, ConcurrentModificationException
Threads / SyncIllegalThreadStateException, IllegalMonitorStateException
Null & TypeNullPointerException, ClassCastException
Illegal State / ArgumentsIllegalArgumentException, UnsupportedOperationException
Input / FormattingInputMismatchException, IllegalFormatException
Resources / ReflectionMissingResourceException, UncheckedIOException

📝 Bonus Tip: Custom Unchecked Exceptions

You can create your own unchecked exceptions like this:

class InvalidAgeException extends RuntimeException {
    public InvalidAgeException(String msg) {
        super(msg);
    }
}