ExamVeda
Login
Home
This question belongs to Java Program Exceptions
Exceptions
?

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.

Answer & Solution
Correct Answer: Option C
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.
Examveda
Question posted by Examveda
Community

Join the Discussion

14 Comments
Srinjoy Paul-2046
Srinjoy Paul-2046 2 years ago
Wrong answer as right answer is C
Yashwant Kumar
Yashwant Kumar 4 years ago
Wrong Answer.
Sachin Sude
Sachin Sude 4 years ago
all Answers are wrong for this question
Alok Pranav
Alok Pranav 4 years ago
It will be A and C
Akshay Kumar
Akshay Kumar 4 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
Riya Joshi
Riya Joshi 5 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.
Anupam Anand
Anupam Anand 8 years ago
if u see the throwable class hierarchy then you see that error is not a subclass of Exception
Anupam Anand
Anupam Anand 8 years ago
No doubt option(C) is the correct Answer
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.
Ajit Ranpise
Ajit Ranpise 9 years ago
Option C
Solomon Alamrew
Solomon Alamrew 10 years ago
so the answer must be C not B make it corecct
Mohit Verma
Mohit Verma 10 years ago
Answer of this question should be C
Akshay Kothari
Akshay Kothari 10 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.
Ramakant Kumar
Ramakant Kumar 10 years ago
answer should be c
b is incorrect