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.
Answer from Mena on Stack Overflow
🌐
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.
🌐
GeeksforGeeks
geeksforgeeks.org › java › types-of-exception-in-java-with-examples
Types of Exception in Java with Examples - GeeksforGeeks
June 1, 2026 - Built-in exceptions are predefined exception classes provided by Java's standard library to handle common runtime and compile-time errors. They help identify and manage abnormal situations such as invalid input, file errors, arithmetic errors, ...
Discussions

Types of Exception in Java - Stack Overflow
I am confused about types of exceptions in Java. On many tutorial websites I have seen that two types of exception are there in java Compile time exception Run time exception But when I talked wit... More on stackoverflow.com
🌐 stackoverflow.com
My personal definitive guide to (java) Exceptions
I finally went on and wrote what i felt like i had to say in the context of exceptions. Since it's such a debated topic, i fully expect some negative backlash, and i have no problem with it, everybody is entitled to their opinion! Let me know if you find it somehow useful. More on reddit.com
🌐 r/java
62
41
March 1, 2021
Exception handling in Java: Advanced features and types
The article has some errors. And not the throwable kind, heh: If not found, it unwinds the method-call stack looking for the closest catch block that can handle the exception. If not found, the JVM terminates with a suitable message. You can see this action in Listing 1. The part in italics is incorrect! What happens if there is no catch block that is suitable is that the thread exits and passes the exception that was never caught to the thread's uncaught exception handler. And that's that. The thread is done. By default, each thread starts with an uncaught exception handler that simply prints the exception to syserr (e.printStackTrace(); - that's the whole body, that's all). At no point does it ever exit a JVM. Of course, if you have a java app that never starts any threads, then the main thread is the only relevant thread, and if that exits due to an exception bubbling all the way up, yeah, sure, the JVM then exits as no non-daemon threads are running. But it feels ridiculous to handwave this away as 'oh we are just trying to keep it simple'. "The thread dies" is just as simple and much more accurate. You can invoke printStackTrace() directly, typically from a catch block. For example, consider a second version of the PrintStackTraceDemo application. This entire article keeps making pointless and misleading sidenotes. For example, it sidenotes 'you can also call printStackTrace(somePrintWriter) which is weird to mention; anybody can look at the API docs and discover this, and it's not like they're covering the entire API here. It's like I'm pointing out all the interesting aspects of the Mona Lisa and then casually remark: "Oh, look, someone dropped a candy wrapper over there. Anyway, moving right along..." - it's just bizarre to mention this. It strongly insinuates that this is important. And that then blows up thoroughly in the quoted section: Newbies are legendary in writing catch blocks with e.printStackTrace(); in it which is a massive anti-pattern that is difficult to eradicate. And this blog post is making it worse by using it as a way to explain that you can invoke printStackTrace yourself (not an important lesson!) without explaining that you shouldn't do that or that this contrived example shouldn't be taken as an insinuation of: "Ah, and this is how you write your standard catch block". Try-with-resources Another example that is fucking horrible. You don't deal with IOExceptions thrown by close() methods by ignoring them!! streams buffer. Any exception thrown by a close() method means the entire write operation has likely failed. If you treat them differently than any exception that would have been thrown by the most recent write call you wrote a hard-to-test for bug (i.e: A really really bad bug). But that isn't obvious here. It's again teaching extremely bad patterns. Listing 8. Copy.java No, the right way to deal with exceptions thrown here is to just declare your main method as throws Exception which you should almost always do. Writing a catch block that tosses most of the useful info in the garbage (as in this snippet, the exception's type which might be FileAccessDeniedException or whatnot - the key info, you toss that away!), then just writes something and blindly continues with the app is ON ERROR RESUME NEXT level stupidity. Common stupidity, but that shouldn't be an excuse. On the contrary, given that the common-ness has proven that your average new java programmer will readily misunderstand, you should go out of your way not to perpetuate this mistake. As is, this article should be torched with a flamethrower: If you send this to new java programmers and they read it, they'll be stupider after having read it than before. The article is fixable though. Come up with less 'actively perpetuating really stupid anti-patterns' examples, stop trying to be opinion-less (because the chosen examples and focus invoke an opinion, whether you intended it or not, and right now it's invoking the wrong ones), and cut some of the irrelevant chaff such as how to make your own stack trace (not relevant for an intro article in any way and actively misleads in suggesting that it is somehow an important tool one should be using often) and mentioning irrelevant parts of the API. More on reddit.com
🌐 r/java
9
17
October 1, 2024
[Java] Incompatible data types

What are you trying to do here? You have declared num to be an array, of length 10, containing Rational objects. That means that num[0], num[1], num[2], …, and num[9] are all individual Rational objects. The index to an array must be an integer: the 0th element of the array is num[0], the 3rd element is num[3], the 9th element is num[9], and so on. It doesn't make sense to use a Rational object as the index to an array. The expression num[u] doesn't make sense if u is a Rational object. What do you intend to mean by that?

More on reddit.com
🌐 r/learnprogramming
16
4
April 30, 2013
🌐
Medium
medium.com › @ShantKhayalian › mastering-java-exception-handling-a-comprehensive-guide-for-developers-c31cef921d75
Mastering Java Exception Handling: A Comprehensive Guide for Developers | by Shant Khayalian | Medium
June 17, 2024 - Unchecked exceptions are subclasses of RuntimeException. Errors: These are serious issues that are not typically caught by the application code. Examples include OutOfMemoryError and StackOverflowError. Errors are subclasses of Error and usually indicate problems that the application cannot recover from. ... Java provides a structured way to handle exceptions using five key keywords: try, catch, finally, throw, and throws.
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › lang › Exception.html
Exception (Java Platform SE 8 )
April 21, 2026 - 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...
Top answer
1 of 7
9

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.

🌐
Raygun
raygun.com › blog › java-exceptions-terminology
Java exceptions: Common terminology with examples · Raygun Blog
October 25, 2022 - Remember that the compiler had no complaints in the case of unchecked exceptions, as they will be thrown only at runtime. If I proceed with the unhandled exception the compiler returns the following error message: Exception in thread "main" java.lang.Error: Unresolved compilation problems: Unhandled exception type IOException Unhandled exception type IOException Unhandled exception type IOException at fileNotFound.FileNotFound.main(FileNotFound.java:8)
🌐
JetBrains
blog.jetbrains.com › home › intellij idea › easy hacks: how to throw java exceptions
Easy Hacks: How to Throw Java Exceptions - The JetBrains Blog
March 12, 2024 - When an exception occurs, the Java ... followed by the exception object. There are two types of exceptions in Java: checked and unchecked....
Find elsewhere
🌐
Electronic Clinic
electroniclinic.com › exceptions-handling-in-java-and-types-of-exceptions-in-java
Exceptions Handling in Java and Types of Exceptions in Java
April 2, 2021 - The following output generated by the JDK (java development kit) interpreter. Stack trace showing the class name “test.main” showing error in the main class test at line no, 7. Now the following program with appropriate handling of exception to terminate normally · This object is thrown exception to the handler which is “catch” which executed the object having exception. In catch arrangements ArithmeticException which is subtype of class Exception. ‘e’ is the object of type “ArithmeticException which receives the exception object.
🌐
Dev.java
dev.java › learn › exceptions
Exceptions - Dev.java
The Java programming language uses exceptions to handle errors and other exceptional events. This tutorial describes when and how to use exceptions. ... Introducing what exceptions are.
🌐
Reddit
reddit.com › r/java › my personal definitive guide to (java) exceptions
r/java on Reddit: My personal definitive guide to (java) Exceptions
March 1, 2021 - Exceptions in Java are either checked (which means your code is polluted by rethrowing them or catching them and wrapping them in unchecked exceptions) or unchecked (which is also bad because the caller isn't made explicitly aware that this ...
🌐
Hero Vired
herovired.com › learning-hub › blogs › types-of-exception-in-java
Types of Exception in Java with Examples | Hero Vired
These types of exceptions in Java are predefined within Java libraries. These types of exceptions in Java occur most frequently. You can consider an Arithmetic Exception in this category. This predefined exception is found in the Java.lang.package.
🌐
W3Schools
w3schools.com › java › java_try_catch.asp
Java Exceptions (Try...Catch)
There are many exception types available in Java: ArithmeticException, FileNotFoundException, ArrayIndexOutOfBoundsException, SecurityException, etc:
🌐
Tutorialspoint
tutorialspoint.com › java › java_builtin_exceptions.htm
Java - Built-in Exceptions
Java defines several exception classes inside the standard package java.lang. The most general of these exceptions are subclasses of the standard type RuntimeException.
🌐
Programming.Guide
programming.guide › java › exception-types.html
Java Exception Types | Programming.Guide
The only Throwable subclasses provided by the Java API are Error and Exception. Throwable is regarded as a checked exception. An Error is thrown to indicate a serious problem that the application should not try to resolve. Error and all its subclasses are regarded as unchecked exceptions.
🌐
Baeldung
baeldung.com › home › java › core java › common java exceptions
Common Java Exceptions | Baeldung
January 8, 2024 - An exception is an event, which occurs during the execution of a program, that disrupts the normal flow of the program’s instructions. Then, we categorized the exceptions into the Checked Exceptions and the Unchecked Exceptions. Next, we discussed different types of exceptions that can come up during the compile time or at the runtime.
🌐
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 errors in Java.
🌐
GeeksforGeeks
geeksforgeeks.org › java › overriding-in-java
Overriding in Java - GeeksforGeeks
Explanation: Although both Manager and Engineer objects are referred to using the Employee type, Java calls the overridden methods of the actual objects at runtime, demonstrating dynamic method dispatch (runtime polymorphism).
Published   May 13, 2026
🌐
Programming.Guide
programming.guide › java › list-of-java-exceptions.html
List of Java Exceptions | Programming.Guide
Java Exception Types · Chained Exceptions · Custom Exception · Difference between Checked and Unchecked Exceptions · Choosing between Checked and Unchecked Exceptions · Checked Exceptions: Good or Bad? Return Values vs Exceptions · try + finally · try-with-resources · Stack Traces · Suppressed Exceptions · throw vs throws vs Throwable · List of Java Exceptions · throw · throws · catch · try · finally · In Java, difference between default, public, protected, and private ...
🌐
Programiz
programiz.com › java-programming › exceptions
Java Exceptions
Some of the common runtime exceptions are: ... You can think about it in this way. "If it is a runtime exception, it is your fault". The NullPointerException would not have occurred if you had checked whether the variable was initialized or not before using it.
🌐
Vlabs
java-iitd.vlabs.ac.in › exp › exceptions › theory.html
Exception Handling in Java - Virtual Labs
statement 6 to 10 will not be executed. If we perform exception handling, the rest of the statement will be executed. That is why we use exception handling in Java. There are mainly two types of exceptions: checked and unchecked. Here, an error is considered as the unchecked exception.