🌐
W3Schools
w3schools.com › java › java_try_catch.asp
Java Exceptions (Try...Catch)
The throw statement is used together with an exception type. There are many exception types available in Java: ArithmeticException, FileNotFoundException, ArrayIndexOutOfBoundsException, SecurityException, etc:
🌐
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 · FOR BUSINESS · CONTACT US · × · If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: [email protected] ·
🌐
GeeksforGeeks
geeksforgeeks.org › java › exceptions-in-java
Java Exception Handling - GeeksforGeeks
Built-in Exception are pre-defined exception classes provided by Java to handle common errors during program execution. There are two type of built-in exception in java.
Published   December 23, 2016
🌐
Tutorialspoint
tutorialspoint.com › java › java_exceptions.htm
Java - Exceptions
These exceptions cannot simply be ignored, the programmer should take care of (handle) these exceptions. For example, if you use FileReader class in your program to read data from a file, if the file specified in its constructor doesn't exist, then a FileNotFoundException occurs, and the compiler prompts the programmer to handle the exception. import java.io.File; import java.io.FileReader; public class FilenotFound_Demo { public static void main(String args[]) { File file = new File("E://file.txt"); FileReader fr = new FileReader(file); } }
🌐
W3Resource
w3resource.com › java-tutorial › types-of-exception.php
Types of Exceptions - w3resource
Checked exceptions are the type that programmers should anticipate and from which programs should be able to recover. All Java exceptions are checked exceptions except those of the Error and RuntimeException classes and their subclasses.
🌐
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.
🌐
W3Schools
w3schools.com › java › java_exceptions_multiple.asp
Java Multiple Exceptions
Java Examples Java Compiler Java Exercises Java Quiz Java Server Java Syllabus Java Study Plan Java Interview Q&A Java Certificate ... Sometimes, different errors (exceptions) can happen in the same try block.
🌐
Educative
educative.io › answers › what-are-different-types-of-exceptions-in-java
What are different types of exceptions in Java?
The table below represents some of the commonly used unchecked exception classes in Java with their description. The Error class represents the serious problems that cause the program to abort. They include out of memory error, stack overflow error, and so on. Now, let's see different types of ...
🌐
Stackify
stackify.com › types-of-exceptions-java
Types of Exceptions in Java - Stackify
March 14, 2024 - Learn about the different types of exceptions in Java (checked and unchecked) and see specific examples.
Find elsewhere
🌐
W3Schools
w3schools.in › java › questions-answers › difference-between-checked-and-unchecked-exceptions-in-java
Difference Between Checked and Unchecked Exceptions in Java
In Java programming, for every ... holds all the details of the exception. Then the program searches for its respective exception handler. If found, the exception is handled or resolved, or else the program execution stops. Java generates two types of exceptions...
🌐
W3Schools
w3schools.com › java › ref_keyword_throws.asp
Java throws Keyword
There are many exception types available in Java: ArithmeticException, ClassNotFoundException, ArrayIndexOutOfBoundsException, SecurityException, etc.
🌐
Scaler
scaler.com › topics › types-of-exception-in-java
Types of Exception in Java - Scaler Topics
November 7, 2022 - An ArithmeticException is thrown when the code does the wrong arithmetic or mathematical operation while executing. Divide by 0 is the most common type of wrong mathematical operation. ... Explanation: Since we are trying to divide 10 by 0, we are causing a mathematical error. This is predefined in the ArithmeticException of Exception class in Java.
🌐
W3Schools
w3schools.in › jsp › exceptions
JSP Exceptions - W3Schools
Here is the list of some of the common examples that occurred in the programming domain: Error: This is a subclass of throwable that indicates serious problems the applications cannot catch. Internal Error: This error occurs when a fault occurs in the Java Virtual Machine (JVM).
🌐
Programiz
programiz.com › java-programming › exceptions
Java Exceptions
In this tutorial, we will learn about exceptions in Java. We will cover about errors, exceptions and different types of exceptions in Java.
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.

🌐
Tutorialspoint
tutorialspoint.com › java › java_builtin_exceptions.htm
Java - Built-in Exceptions
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. Java defines several other types of exceptions that relate to its various class libraries.
🌐
W3Schools Blog
w3schools.blog › home › exception handling tutorial java
Exception handling tutorial Java - W3schools
August 3, 2015 - Exception handling tutorial in java: Exception refers to an exceptional event. Exception is an event that disrupts the normal flow of the program, during program execution.
🌐
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 - ArrayIndexOutofBounds Exception: It occurs in the case of an out-of-bound array index. The ERROR class refers to serious problems causing a program to abort. The different types of errors in Java are as follows:
🌐
Vlabs
java-iitd.vlabs.ac.in › exp › exceptions › theory.html
Exception Handling in Java - Virtual Labs
Suppose there are 10 statements ... will be executed. That is why we use exception handling in Java. There are mainly two types of exceptions: checked and unchecked....
🌐
Oracle
docs.oracle.com › javase › tutorial › essential › exceptions
Lesson: Exceptions (The Java™ Tutorials > Essential Java Classes)
The discussion includes the try, catch, and finally blocks, as well as chained exceptions and logging. This section covers the throw statement and the Throwable class and its subclasses. This section describes the try-with-resources statement, which is a try statement that declares one or more ...