Unchecked Exception List
ArrayIndexOutOfBoundsException
ClassCastException
IllegalArgumentException
IllegalStateException
NullPointerException
NumberFormatException
AssertionError
ExceptionInInitializerError
StackOverflowError
NoClassDefFoundError

Checked Exception List
Exception
IOException
FileNotFoundException
ParseException
ClassNotFoundException
CloneNotSupportedException
InstantiationException
InterruptedException
NoSuchMethodException
NoSuchFieldException

Answer from Praveen Kishor on Stack Overflow
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ java โ€บ types-of-exception-in-java-with-examples
Types of Exception in Java with Examples - GeeksforGeeks
July 23, 2025 - The following program illustrates how to create your own exception class MyException. Details of account numbers, customer names, and balance amounts are taken in the form of three arrays. In main() method, the details are displayed using a for-loop. At this time, a check is done if in any account the balance amount is less than the minimum balance amount to be apt in the account. If it is so, then MyException is raised and a message is displayed โ€œBalance amount is lessโ€. ... // Java program to demonstrate user defined exception // This program throws an exception whenever balance // amoun
๐ŸŒ
W3Schools
w3schools.com โ€บ java โ€บ java_ref_errors.asp
Java Error and Exception Types Reference
close() delimiter() findInLine() findWithinHorizon() hasNext() hasNextBoolean() hasNextByte() hasNextDouble() hasNextFloat() hasNextInt() hasNextLine() hasNextLong() hasNextShort() locale() next() nextBoolean() nextByte() nextDouble() nextFloat() nextInt() nextLine() nextLong() nextShort() radix() reset() useDelimiter() useLocale() useRadix() Java File Methods Java FileInputStream Java FileOutputStream Java BufferedReader Java BufferedWriter Java Iterator Methods Java Collections Methods Java System Methods Java Errors & Exceptions ยท Java Examples Java Compiler Java Exercises Java Quiz Java Server Java Syllabus Java Study Plan Java Interview Q&A Java Certificate ยท โฎ Previous Next โฏ ยท The table below shows a list of common Error and Exception types in Java: Java Errors Tutorial ยท
Discussions

Most common checked and unchecked Java Exceptions? - Stack Overflow
I would like to contribute a list that groups by situation, which is probably more meaningful than grouping by packages or fields of programming. These are exceptions that should ideally never be thrown in production. You should fix them instead of catching them and stfu. They should never happen again once you see them. ... I hope you won't end up finding out that your code is correct and you accidentally inverted your assertion ... I hope you know well enough that Java ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
What are the most commonly used runtime exceptions in java? - Stack Overflow
One violation of this is that sometimes you'll need to wrap what ought to be a checked exception in a RuntimeException, in order to satisfy the definition of an interface. As a brief example, you might have some snazzy implementation of java.util.List that manages a distributed list between ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
List of common java exceptions. Wait... WTF
quotation from article lol More on reddit.com
๐ŸŒ r/programming
116
1025
January 4, 2009
Creating a list of Exceptions in java - Stack Overflow
I want to create a list of Exceptions in java. More on stackoverflow.com
๐ŸŒ stackoverflow.com
๐ŸŒ
Baeldung
baeldung.com โ€บ home โ€บ java โ€บ core java โ€บ common java exceptions
Common Java Exceptions | Baeldung
January 8, 2024 - When a program evaluates an arithmetic operation and it results in some exceptional condition, it throws ArithmeticException. In addition, ArithmeticException applies to only int and long data types. For instance, if we try to divide an integer by zero, we get an ArithmeticException: int illegalOperation = 30/0; // Throws ArithmeticException ยท Java allows typecasting between the objects in order to support inheritance and polymorphism.
๐ŸŒ
Oracle
docs.oracle.com โ€บ javase โ€บ 8 โ€บ docs โ€บ api โ€บ java โ€บ lang โ€บ Exception.html
Exception (Java Platform SE 8 )
October 20, 2025 - Constructs a new exception with the specified detail message, cause, suppression enabled or disabled, and writable stack trace enabled or disabled. ... cause - the cause. (A null value is permitted, and indicates that the cause is nonexistent or unknown.) enableSuppression - whether or not suppression is enabled or disabled ยท writableStackTrace - whether or not the stack trace should be writable ... Java...
๐ŸŒ
Rollbar
rollbar.com โ€บ home โ€บ java exceptions hierarchy explained
Java Exceptions Hierarchy Explained | Rollbar
May 15, 2025 - The class at the top of the exception class hierarchy is the Throwable class, which is a direct subclass of the Object class. Throwable has two direct subclasses - Exception and Error. The diagram below shows the standard exception and error classes defined in Java, organized in the Java exceptions hierarchy:
๐ŸŒ
Tutorialspoint
tutorialspoint.com โ€บ java โ€บ java_builtin_exceptions.htm
Java - Built-in Exceptions
Built-in Exceptions in Java are categorized into two categories Checked Exceptions and Unchecked Exceptions. Checked Exceptions: The checked exceptions are handled by the programmer during writing the code, they can be handled using the try-catch block. These exceptions are checked at compile-time. Unchecked Exceptions: The unchecked exceptions are not handled by the programmer. These exceptions are thrown on run-time. Some of the unchecked exceptions are NullPointerException, ArrayIndexOutOfBoundsException, ArithmeticException, etc.
Find elsewhere
๐ŸŒ
Programming.Guide
programming.guide โ€บ java โ€บ list-of-java-exceptions.html
List of Java Exceptions | Programming.Guide
This page provides a complete list of all public exceptions and errors available in the Java API, grouped by package.
๐ŸŒ
Pluralsight
pluralsight.com โ€บ blog โ€บ software development
How to handle the 10 most common exceptions in Java | Online Courses, Learning Paths, and Certifications - Pluralsight
July 17, 2024 - Like IOException, this exception may be thrown when connecting with a database. Most often, though, it indicates a problem with how the database rejected the SQL provided by the application. This may be due to a few things: ... Databases arenโ€™t always the most helpful at determining the exact problem. When investigating, consider turning up logging to see the exact SQL query in question. SQLException is also thrown by the Java API for formulating and transmitting queries.
๐ŸŒ
Stackify
stackify.com โ€บ types-of-exceptions-java
Types of Exceptions in Java - Stackify
March 14, 2024 - Error as illustrated in Figure 1. The error can be defined as an abnormal condition that indicates something has gone wrong with the execution of the program. These are not handled by Java programs. There are some important methods available in the Throwable class which are as follows: public String getMessage() โ€“ Provides information about the exception that has occurred through a message, which is initialized in the Throwable constructor.
Top answer
1 of 6
68

I never throw NullPointerException. For me, it is one that appears naturally in the code when something goes wrong and that requires a developer to look at what happens. Then (s)he fixes the cause and it doesn't happen again.

I use IllegalStateException to signal that an object is incorrectly configured or that calls are in an incorrect order. However, we all know that ideally, an object should ensure it can't be in a bad state and that you can't call it in incorrect order (make a builder and a resulting object ...).

I use a lot of IllegalArgumentException when a method detects that its parameters are incorrect. This is the responsibility of any public method, to stop processing (to avoid indirect errors that are more difficult to understand). Also, a few ifs in the beginning of a method serve a documentation purpose (documentation that never diverge from the code because it is the code :-) ).

     public void myMethod(String message, Long id) {
       if (message == null) {
          throw new IllegalArgumentException("myMethod's message can't be null");
          // The message doesn't log the argument because we know its value, it is null.
       }
       if (id == null) {
          throw new IllegalArgumentException("myMethod's id can't be null");
          // This case is separated from the previous one for two reasons :
          // 1. to output a precise message
          // 2. to document clearly in the code the requirements
       }
       if (message.length()<12) {
          throw new IllegalArgumentException("myMethod's message is too small, was '" + message + "'");
          // here, we need to output the message itself, 
          // because it is a useful debug information.
       }
     }

I also use specific Runtime Exceptions to signal higher level exceptional conditions.

For example, if a module of my application couldn't start, I might have a ModuleNotOperationalException thrown (ideally by a generic code like an interceptor, otherwise by a specific code) when another module calls it. After that architectural decision, each module has to deal with this exception on operations that call other modules...

2 of 6
12

I've always considered that runtime exceptions should represent programming errors (e.g. null reference passed in when not expected, array index out of bounds, etc.) while checked exceptions should represent exceptional conditions in the environment that cannot be "coded away" (e.g. IOException, SQLException).

One violation of this is that sometimes you'll need to wrap what ought to be a checked exception in a RuntimeException, in order to satisfy the definition of an interface. As a brief example, you might have some snazzy implementation of java.util.List that manages a distributed list between multiple machines. Clearly this would throw checked exceptions (probably some subclass of IOException) if defined on its own, but the benefits of making this class implement List is that clients can use it almost transparently, anywhere they use another list.

This can lead to what Joel terms a leaky abstraction, though, so it's important that your documentation is clear what exceptions can be thrown and what they mean! In this case I find a custom subclass of RuntimeException to generally be clearer at communicating the root cause rather than trying to shoehorn it into an existing runtime exception class.

๐ŸŒ
Reddit
reddit.com โ€บ r/programming โ€บ list of common java exceptions. wait... wtf
r/programming on Reddit: List of common java exceptions. Wait... WTF
January 4, 2009 - Then GTFO out of Programming. ... Sorry - didn't mean to hit a nerve. More replies More replies ... AWTException: You are using AWT, which means your GUI will be ugly. This exception is only a warning and can be ignored. ... This is lame and dripping with no sex. ... ClassCastException You need to stay in the class or caste you were born into. Java will not accept dailits acting as kshatriyas or noblemen pretending to be working class.
๐ŸŒ
Rollbar
rollbar.com โ€บ home โ€บ most common java exceptions
Most Common Java Exceptions | Rollbar
November 28, 2022 - For instance, if a program attempts to access a file that is currently unavailable, the method to access the file must either catch or throw a FileNotFoundException. Error - errors are exceptions that happen externally to your Java program. One common example of the error is when the Java virtual machine (JVM) runs out of memory, which will throw an OutOfMemoryError.
๐ŸŒ
UW Computer Sciences
pages.cs.wisc.edu โ€บ ~paton โ€บ readings โ€บ Old โ€บ fall08 โ€บ 3.EXCEPTIONS.html
JAVA EXCEPTIONS
The first time, method e throws exception Ex1, the second time, it throws exception Ex2, etc. For each of the four runs, say what is printed, and whether any uncaught exception is thrown. ... Java exceptions are objects.
๐ŸŒ
Stack Overflow
stackoverflow.com โ€บ questions โ€บ 62732729 โ€บ generic-list-of-exception
java - Generic list of Exception - Stack Overflow
MyExceptionHolder myExceptionHolder = new MyExceptionHolder(); myExceptionHolder.addExceptions(new RuntimeException()); myExceptionHolder.addExceptions(new ArithmeticException()); List exs = myExceptionHolder.getExceptions(); Assert.assertTrue(exs.get(0) instanceof RuntimeException ); Assert.assertTrue(exs.get(1) instanceof ArithmeticException ); ... But MyExceptionHolder myExceptionHolder = new MyExceptionHolder(); could be simplified to List<Exception> myExceptionHolder = new ArrayList<>(); - without any wildcards. And the code would run fine. 2020-07-04T18:47:00.83Z+00:00 ... True. It will definitely serve the purpose of holding all types of Exceptions and in much simpler way.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ java โ€บ exceptions-in-java
Java Exception Handling - GeeksforGeeks
Exception caught: java.lang.ArrayIndexOutOfBoundsException: Index 5 out of bounds for length 3 This block always executes.
Published ย  1 month ago
๐ŸŒ
CodeJava
codejava.net โ€บ java-core โ€บ exception โ€บ java-checked-and-unchecked-exceptions
Java Checked and Unchecked Exceptions
February 10, 2025 - WriteAbortedException Common checked exceptions defined in the java.net package (almost are subtypes of IOException):
๐ŸŒ
W3Schools
w3schools.com โ€บ java โ€บ java_try_catch.asp
Java Exceptions (Try...Catch)
The table below shows some of the most common errors and exceptions in Java, with a short description of each: Tip: For a list of all errors and exception types, go to our Java Errors and Exception Types Reference.