
- 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
What are the differences between an Exception class and an Error class in Java?n
Both an Exception class and an Error class are subclasses of java.lang.Throwable class, we can able to handle the exceptions at runtime but the errors we cannot handle.
- Exceptions are the objects representing the logical errors that occur at the run time and makes JVM enters into the state of "ambiguity".
- The objects which are automatically created by the JVM for representing these run time errors are known as an Exception. An Error is a subclass of Throwable class that indicates serious problems that a reasonable application should not try to catch. Most such errors are abnormal conditions.
- If an exception occurs we can handle it by using try and catch block. If an error occurs we can not handle it, program execution will be terminated.
- In Exception we have two types, one is Checked Exception and another is Unchecked Exception, Error is by default unchecked Exception.
- An exception is of type java.lang.Exception and an error is of type java.lang.Error.
- Related Articles
- What are the differences between a class and an interface in Java?
- What are the differences between an event listener interface and an event adapter class in Java?
- What are the differences between class methods and class members in C#?
- Differences between abstract class and concrete class in Java
- What are the differences between struct and class in C++?
- Differences between Interface and class in Java
- What are the differences between an Integer and an int in Java?
- What are the differences between an application and an applet in Java?
- What are the differences between a class and struct in C#?
- Differences between abstract class and interface in Java
- What are the differences between a class and a structure in C#?
- Difference between Exception and Error in Java
- Difference Between Error and Exception in Java
- What is the difference between an interface and an abstract class in C#?
- Differences between anonymous class and lambda expression in Java?\n

Advertisements