Examveda

Which of the below statement is/are true about Error?
A. An Error is a subclass of Throwable.
B. An Error is a subclass of Exception.
C. Error indicates serious problems that a reasonable application should not try to catch.
D. An Error is a subclass of IOException.

A. A and D

B. A and B

C. A and C

D. B and C

E. B and D

Answer: Option C

Solution (By Examveda Team)

Statement A: This is true. In Java, Error is indeed a direct subclass of Throwable, which is the superclass of all errors and exceptions in the Java language.

Statement B: This is false. Error is not a subclass of Exception. Both Error and Exception are direct subclasses of Throwable but are distinct from each other.

Statement C: This is true. Errors generally indicate serious problems that a reasonable application should not try to catch. These are conditions that are usually outside the control of the program and require intervention at a higher level (such as the runtime environment). Examples include virtual machine errors, out-of-memory errors, etc.

Statement D: This is false. Error is not a subclass of IOException. IOException is a subclass of Exception, specifically used for handling I/O-related issues.

Correct Statements: A and C:
Option C is correct because it includes the accurate statements about Error in Java.
Example for better understanding: In Java, Error and Exception classes are used for different purposes. Errors indicate problems that are typically not expected to be caught by applications, such as out-of-memory errors, while exceptions are conditions that applications might want to catch and handle, such as file not found exceptions.

This Question Belongs to Java Program >> Exceptions

Join The Discussion

Comments (14)

  1. Srinjoy Paul-2046
    Srinjoy Paul-2046:
    2 years ago

    Wrong answer as right answer is C

  2. Yashwant Kumar
    Yashwant Kumar:
    3 years ago

    Wrong Answer.

  3. Sachin Sude
    Sachin Sude:
    3 years ago

    all Answers are wrong for this question

  4. Alok Pranav
    Alok Pranav:
    3 years ago

    It will be A and C

  5. Akshay Kumar
    Akshay Kumar:
    3 years ago

    how it can be A and B, according to explanation it should be A and C
    please check ans you provide it is wrong

  6. Riya Joshi
    Riya Joshi:
    4 years ago

    Please Change your answer to option C as Statement A and C are true in case of an Error. And it's not a subclass of Exception class.

  7. Anupam Anand
    Anupam Anand:
    7 years ago

    if u see the throwable class hierarchy then you see that error is not a subclass of Exception

  8. Anupam Anand
    Anupam Anand:
    7 years ago

    No doubt option(C) is the correct Answer

  9. Priyabrata Biswal
    Priyabrata Biswal:
    8 years ago

    Error is not a sub class of exception and option-c is also correct.
    so option A and C are correct.

  10. Ajit Ranpise
    Ajit Ranpise:
    8 years ago

    Option C

  11. Solomon Alamrew
    Solomon Alamrew:
    9 years ago

    so the answer must be C not B make it corecct

  12. Mohit Verma
    Mohit Verma:
    9 years ago

    Answer of this question should be C

  13. Akshay Kothari
    Akshay Kothari:
    9 years ago

    Option C) Is correct because error is a subclass of throwable class and more it ndicates serious problems that a reasonable application should not try to catch.

  14. Ramakant Kumar
    Ramakant Kumar:
    9 years ago

    answer should be c
    b is incorrect

Related Questions on Exceptions