RuntimeException & Error

Viewed 25005

In the exceptions hierarchy, the descendants of RuntimeException and those of Error are runtime exceptions/errors.

The difference between the two is: Those under RuntimeException are the ones caused by poor programming/design, and those of Error are the ones that can't/shouldn't be controlled by the developer.

For coding an exception within the application, for instance, to throw an exception when something in the business logic occurs, the RuntimeException is extended.

The question is, what exactly is the difference between extending RuntimeException and extending Error-- except that extending Error is bad practice?

2 Answers
Related