Java Synchronous and Asynchronous Exceptions

In this Java tutorial, learn about asynchronous and synchronous exceptions in Java. Learn how they are different with checked and unchecked exceptions.

1. Asynchronous and synchronous exceptions

Normally Java differentiate the exceptions in two categories on basis of “timing” when they are discovered. These categories are checked and unchecked exceptions.

Similarly, on the basis of place of occurrence, Java exceptions can be divided further in two categories.

  1. Synchronous exceptions
  2. Asynchronous exceptions

2. Synchronous exception

Synchronous exceptions happen at a specific program statement, no matter, how many times we run a program in similar execution environment.

Example of synchronous exceptions are what we care for in our daily life as developer i.e. NullPointerException or ArrayIndexOutOfBoundsException etc.

For example, we run a Java program ‘N’ times with same input. If NullPointerException occur at line number ‘M’ then they will occur at a same line number every time. This is example of synchronous exception in Java.

3. Asynchronous exception

Asynchronous exceptions can raise practically anywhere. It follows that asynchronous exception handling can’t be required by the compiler. They are also difficult to program with.

Examples of naturally asynchronous events include pressing Ctrl-C to interrupt a program, or receiving a signal such as “stop” or “suspend” from another thread of execution. For example, if you press ‘CTRL + C’ N times during application execution, no one can guarantee the line number on which the application will end.

I hope that this discussion about Java synchronous and asynchronous exceptions will help you in programming activities as well as Java interviews.

Happy Learning !!

Read More: Oracle Docs

Was this post helpful?

Join 7000+ Awesome Developers

Get the latest updates from industry, awesome resources, blog updates and much more.

* We do not spam !!

1 thought on “Java Synchronous and Asynchronous Exceptions”

  1. Thanks a lot Lokesh. This discussion was really so much practical and helpful to go in depth of Java programming. Thanks a lot !!


Leave a Comment


A blog about Java and related technologies, the best practices, algorithms, and interview questions.