
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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 Questions & Answers
- Difference between Exception and Error in Java
- Differentiate between exception and error in PHP
- Difference Between Checked and Unchecked Exception in Java
- Difference between system level exception and Application level exception.
- What are the differences between an Exception class and an Error class in Java?
- What is the difference between Flow Control and Error Control?
- What is the difference between error () and ajaxError() events in jQuery?
- Difference between Java and JavaScript.
- Difference between Go and Java.
- Difference Between C++ and Java
- What is the difference between throw e and throw new Exception(e) in catch block in java?
- What is the difference between 'except Exception as e' and 'except Exception, e' in Python?
- Difference between Java and C language
- Difference between constructor and method in Java
- Difference between HashMap and HashTable in Java.
Advertisements