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?
RuntimeException(directly or indirectly)."RuntimeExceptionshould indicate "programming errors", for example, invalid pre-conditions when calling a method. The specific case you describe (HW failure) may potentially crash the JVM (in which case, anErrorwill be raised) but anyways, it does not sound like "programming error". I guess that the answer depends on how such a problem will effect your program/OS. It's important to remember that there's no behavioral difference betweenRuntimeExceptionandError- only semantic which is whyRuntimeExceptionwould probably still fit.