Java error exception: What is the difference between error and an exception?

What is the difference between error and an exception?

1. Errors are abnormal conditions that should never occur. Not to be confused with the compile time errors.

2. A method is not required to declare in its throws clause any subclasses of Error that might be thrown during the execution of the method but not caught.

3. An exception is a condition that a programmer has already predicted. These can be caught unlike errors. They occur due to bad input, etc.
What is the difference between preemptive scheduling and time slicing?
Java pre-emptive scheduling and time slicing - Under time slicing, a task executes for a predefined slice of time and then reenters the pool of ready tasks...
Java serializable Interface - What is serializable Interface?
Java serializable Interface - If we want to transfer data over a network then it needs to be serialized. Objects cannot be transferred as they are...
How does thread synchronization occurs inside a monitor?
Java thread synchronization - A Monitor defines a lock and condition variables for managing concurrent access to shared data...
Post your comment