🌐
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. Program continues... 1. throw: Used to explicitly throw a single exception. We use throw when something goes wrong (or “shouldn’t happen”) and we want to stop normal flow and hand control to exception handling.
Published   December 23, 2016
🌐
GeeksforGeeks
geeksforgeeks.org › java › types-of-exception-in-java-with-examples
Types of Exception in Java with Examples - GeeksforGeeks
July 23, 2025 - ArithmeticException: It is thrown when an exceptional condition has occurred in an arithmetic operation. ArrayIndexOutOfBoundsException: It is thrown to indicate that an array has been accessed with an illegal index.
People also ask

How can developers get started with Sentry for exception handling in Java?

Developers can access Sentry’s documentation and signup to start leveraging its features for exception monitoring and debugging in Java applications. Sentry offers comprehensive guides and resources to help developers integrate and configure the platform effectively.

🌐
blog.sentry.io
blog.sentry.io › exception-handling-in-java-with-real-examples
Exception Handling in Java (with Real Examples) | Product Blog ...
What benefits does Sentry offer for exception handling and debugging in Java?

Sentry streamlines the debugging process by organizing exceptions into issues, providing detailed insights into their occurrence frequency and impact on users. Developers can visualize exception traces, analyze code segments, and scrub sensitive data for enhanced security. Additionally, Sentry offers comprehensive performance monitoring to track application latency and transaction success/failure.

🌐
blog.sentry.io
blog.sentry.io › exception-handling-in-java-with-real-examples
Exception Handling in Java (with Real Examples) | Product Blog ...
What types of exceptions exist in Java, and how are they classified?

Java exceptions are broadly categorized into checked and unchecked exceptions. Checked exceptions are detected during compilation, while unchecked exceptions occur at runtime. Additionally, developers can create custom exceptions to handle specific business logic.

🌐
blog.sentry.io
blog.sentry.io › exception-handling-in-java-with-real-examples
Exception Handling in Java (with Real Examples) | Product Blog ...
🌐
W3Schools
w3schools.com › java › java_try_catch.asp
Java Exceptions (Try...Catch)
As mentioned in the Errors chapter, different types of errors can occur while running a program - such as coding mistakes, invalid input, or unexpected situations. When an error occurs, Java will normally stop and generate an error message. The technical term for this is: Java will throw an exception (throw an error). Exception handling ...
🌐
Stackify
stackify.com › types-of-exceptions-java
Types of Exceptions in Java - Stackify
March 14, 2024 - There are mainly two types of exceptions in Java as follows: ... Checked exceptions are also known as compile-time exceptions as these exceptions are checked by the compiler during the compilation process to confirm whether the exception is ...
🌐
Raygun
raygun.com › blog › java-exceptions-terminology
Java exceptions: Common terminology with examples · Raygun Blog
October 25, 2022 - For example, IOException is a subclass of Exception and NullPointerException is a subclass of RuntimeException. You may have noticed that Java differentiates errors from exceptions. ... In Java, errors indicate abnormal conditions such as stack overflow that applications shouldn’t try to catch. They are mostly caused by the environment, as opposed to exceptions that are caused by the program itself. Exceptions are caught either at compile time or at runtime. Errors terminate the program for sure and they cannot be handled in any way.
🌐
Tutorialspoint
tutorialspoint.com › java › java_exceptions.htm
Java - Exceptions
Try to understand the difference between throws and throw keywords, throws is used to postpone the handling of a checked exception and throw is used to invoke an exception explicitly. The following method declares that it throws a RemoteException − · import java.io.*; public class className { public void deposit(double amount) throws RemoteException { // Method implementation throw new RemoteException(); } // Remainder of class definition }
🌐
Programiz
programiz.com › java-programming › exception-handling
Java Exception Handling (With Examples)
We can use the try...catch block, finally block, throw, and throws keyword to handle exceptions in Java. In this tutorial, we will learn about Java exception handling with the help of examples.
🌐
Vlabs
java-iitd.vlabs.ac.in › exp › exceptions › theory.html
Exception Handling in Java - Virtual Labs
In Java, an exception is an event that disrupts the normal flow of the program. It is an object which is thrown at runtime. Exception Handling is a mechanism to handle runtime errors such a ClassNotFoundException, IOException, SQLException, RemoteException, etc.
Find elsewhere
🌐
Sentry
blog.sentry.io › exception-handling-in-java-with-real-examples
Exception Handling in Java (with Real Examples) | Product Blog • Sentry
July 15, 2025 - What types of exceptions exist in Java, and how are they classified? Java exceptions are broadly categorized into checked and unchecked exceptions. Checked exceptions are detected during compilation, while unchecked exceptions occur at runtime.
🌐
Baeldung
baeldung.com › home › java › core java › exception handling in java
Exception Handling in Java | Baeldung
May 11, 2024 - A couple of examples of checked exceptions are IOException and ServletException. Unchecked exceptions are exceptions that the Java compiler does not require us to handle.
🌐
ScholarHat
scholarhat.com › home
What is Exception Handling in Java?: try, catch, throw, finally
When learning Java, one must be ... a technique for handling different types of errors, such as File Not Found Exceptions, IO Exceptions, Class Not Found Exceptions, etc....
Published   September 9, 2025
🌐
W3Schools
w3schools.com › java › java_ref_errors.asp
Java Error and Exception Types Reference
The table below shows a list of common Error and Exception types in Java: Java Errors Tutorial · Java Exception Handling Tutorial · ❮ Previous Next ❯ · ★ +1 · Sign in to track progress · REMOVE ADS · PLUS · SPACES · GET CERTIFIED · FOR TEACHERS ·
🌐
Scaler
scaler.com › topics › types-of-exception-in-java
Types of Exception in Java - Scaler Topics
November 7, 2022 - An example of a built-in exception can be ArithmeticException; it is a pre-defined exception in the Exception class of java.lang package. These can be further divided into two types: ... Checked exceptions are caught at compile time, indicating potentially recoverable errors. The compiler enforces handling them before runtime.
🌐
Javatpoint
javatpoint.com › exception-handling-in-java
Exception Handling in Java
Exception Handling in Java or Java Exceptions with checked, unchecked and errors with example and usage of try, catch, throw, throws and finally keywords.
🌐
Educative
educative.io › answers › what-are-different-types-of-exceptions-in-java
What are different types of exceptions in Java?
If a method throws a checked exception, then the caller of the method must either handle the exception or declare it in the throws clause. Unchecked exceptions: These are the exceptions that are not checked by the compiler at compile time. They include runtime exceptions and errors. The exception class hierarchy in Java is as follows:
Top answer
1 of 7
8

There are 3 types of Throwables in Java.

  • Checked Exceptions (Exception and down the chain, save for RuntimeException). These are checked by the compiler and must be caught when thrown. They represent an exceptional condition that is usually recoverable, e.g. when a referenced file is not found on the file system (see FileNotFoundException).
  • Unchecked or runtime Exceptions (children of RuntimeException). These can be thrown without catching. They typically represent programming errors, for instance invoking methods on a null object (see NullPointerException).
  • Errors. These are unchecked as well. They are thrown by the JVM when something very wrong is happening, typically beyond the developer's direct control (e.g. out of memory, see OutOfMemoryError). Compiler errors are issued by the Java compiler when your code fails to compile, for various reason such as bad syntax, ambiguous calls, failing to catch a checked Exception, etc. etc.
2 of 7
4

Any "famous website" that said that should not be read. It is rubbish. There is no such thing as a "compile time exception". The Java Geeks you were talking to are correct1.

Actually, you probably misread or misunderstood what you read on those "famous sites". There are "compile time ERRORS" and "run time EXCEPTIONS".

In your example, what you have is a couple of compile time error message, that are due to errors in your code. The errors are there because your code does not handle exceptions correctly, but they are ERRORS nonetheless. And they are detected at compile time ... by the Java compiler.


1 ... and maybe it is time to stop using semi-derogatory labels like "geek" for them. It sounds like they deserve some respect.

🌐
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...
🌐
Hero Vired
herovired.com › home page › blogs › types of exception in java with examples | hero vired
Types of Exception in Java with Examples | Hero Vired
January 11, 2025 - These types of exceptions in Java are called compile-time exceptions. These exceptions are checked by the compiler while the compilation process is ongoing. These types of exceptions in Java can confirm whether a programmer is handling a specific exception.
🌐
Scaler
scaler.com › topics › java › exception-handling-in-java
Exception Handling in Java - Scaler Topics
January 5, 2022 - Exceptions can be of both checked(exceptions that are checked by the compiler) and unchecked(exceptions that cannot be checked by the compiler) type. They can occur at both run time and compile time.
🌐
InfoWorld
infoworld.com › home › blogs › java 101: learn java › exception handling in java: the basics
Exception handling in Java: The basics | InfoWorld
May 22, 2025 - Java classifies exceptions into a few types: checked exceptions, unchecked exceptions, and errors, which must be handled by the JVM. I’ll have more below about how the Java virtual machine handles exceptions.