
- Java Tutorial
- Java - Home
- Java - Overview
- Java - Environment Setup
- Java - Basic Syntax
- Java - Object & Classes
- Java - Constructors
- Java - Basic Datatypes
- Java - Variable Types
- Java - Modifier Types
- Java - Basic Operators
- Java - Loop Control
- Java - Decision Making
- Java - Numbers
- Java - Characters
- Java - Strings
- Java - Arrays
- Java - Date & Time
- Java - Regular Expressions
- Java - Methods
- Java - Files and I/O
- Java - Exceptions
- Java - Inner classes
- Java Object Oriented
- Java - Inheritance
- Java - Overriding
- Java - Polymorphism
- Java - Abstraction
- Java - Encapsulation
- Java - Interfaces
- Java - Packages
- Java Advanced
- Java - Data Structures
- Java - Collections
- Java - Generics
- Java - Serialization
- Java - Networking
- Java - Sending Email
- Java - Multithreading
- Java - Applet Basics
- Java - Documentation
- Java Useful Resources
- Java - Questions and Answers
- Java - Quick Guide
- Java - Useful Resources
- Java - Discussion
- Java - Examples
Difference Between Error and Exception in Java
In this post, we will understand the difference between error and exception.
Error
It is classified as an unchecked type.
It belongs to the class ‘java.lang.error’.
It can’t be recovered from.
It can't occur at compile time.
Examples of errors include −
‘OutOfMemoryError’
‘IOError’
Exception
It can be classified into unchecked and checked exceptions.
It belongs to the class ‘java.lang.Exception’.
It can be recovered from.
It can occur at runtime as well as compile time.
Examples of exceptions include −
NullPointerException
SqlException
- Related Articles
- Difference between Exception and Error in Java
- Differentiate between exception and error in PHP
- Difference Between Checked and Unchecked Exception in Java
- Difference between Interrupt and Exception
- What are the differences between an Exception class and an Error class in Java?\n
- Difference between system level exception and Application level exception.
- What is the difference between throw e and throw new Exception(e) in catch block in java?
- What is the difference between error () and ajaxError() events in jQuery?
- What is the difference between Flow Control and Error Control?
- What is the difference between 'except Exception as e' and 'except Exception, e' in Python?
- How to print the Python Exception/Error Hierarchy?
- Difference between Java and JavaScript.
- Difference between Go and Java.
- Difference Between C++ and Java
- Difference between Groovy and Java

Advertisements