Hi all,
I'd like to ask you about a terminology confusion which I've faced recently. I hope you wouldn't mind about this basic "wording" stuff.
Q7-6. Select the incorrect statement(s):
a java.lang.Throwable is the base class of all type of exceptions.
b If a class is a subclass of java.lang.Exception, it may or may not be a checked
exception.
c Error is an unchecked exception.
d Error and checked exceptions need not be part of a method signature.
Is Error an unchecked exception? In Java Tutorial page I see the following explanation in bold, which makes me to think that an Error is unchecked exception. On the other hand I know that Error is a subclass of Throwable and doesn't inherit from Exception. Or should we say Error is an unchecked Throwable?
From Java Tutorials (
http://docs.oracle.com/javase/tutorial/essential/exceptions/runtime.html)
Because the Java programming language does not require methods to catch or to
specify unchecked exceptions (RuntimeException, Error, and their subclasses), programmers may be tempted to write code that throws only unchecked exceptions or to make all their exception subclasses inherit from RuntimeException. Both of these shortcuts allow programmers to write code without bothering with compiler errors and without bothering to specify or to catch any exceptions. Although this may seem convenient to the programmer, it sidesteps the intent of the catch or specify requirement and can cause problems for others using your classes.
Another resource which causes confusion taken from an arbitrary website: