Which two statements are true?
A. Error class is unextendable.
B. Error class is extendable.
C. Error is a RuntimeException.
D. Error is an Exception.
E. Error is a Throwable.
Which two statements are true?
A. Error class is unextendable.
B. Error class is extendable.
C. Error is a RuntimeException.
D. Error is an Exception.
E. Error is a Throwable.
BE
incorrect answer given,
since error class is not final, it is extendable
and error class extends throwable. so option B,E are correct
Error class is not final. Therefore, Error class is extendable.
Hierarchy for RuntimeException class (Top to Bottom)
Throwable (parent) -> Exception (child) -> RuntimeException (child)
Hierarchy for Error class (Top to Bottom)
Throwable (Parent) -> Error (child)
Key points from the above hierarchy :
Error is Throwable
Error is not RuntimeException.
Error is not an Exception
Answer: B and E
option B and E is right. Throwable class is the superclass of all errors and exceptions.
B and E answer. Error is not a RunTimeException, it is a subclass of Throwable and it is extandable
B E