1Z0-803 · Question #267
Which two statements correctly describe checked exception?
The correct answer is A. These are exceptional conditions that a well-written application should anticipate and recover E. Every class that is a subclass of Exception, excluding RuntimeException and its subclasses,. This question evaluates understanding of checked exceptions in Java, covering their purpose and formal classification within the exception hierarchy.
Question
Which two statements correctly describe checked exception?
Options
- AThese are exceptional conditions that a well-written application should anticipate and recover
- BThese are exceptional conditions that are external to the application, and that the application
- CThese are exceptional conditions that are internal to the application, and that the application
- DEvery class that is a subclass of RuntimeException and Error is categorized as checked
- EEvery class that is a subclass of Exception, excluding RuntimeException and its subclasses,
How the community answered
(55 responses)- A91% (50)
- B2% (1)
- C5% (3)
- D2% (1)
Why each option
This question evaluates understanding of checked exceptions in Java, covering their purpose and formal classification within the exception hierarchy.
Checked exceptions represent exceptional conditions that are typically recoverable and that a robust application should foresee and handle programmatically, such as file I/O errors or network issues.
This statement is incomplete and too broad; exceptional conditions, whether external or internal, can manifest as either checked or unchecked exceptions depending on their recoverability and type.
This statement is incomplete and too broad; exceptional conditions, whether external or internal, can manifest as either checked or unchecked exceptions depending on their recoverability and type.
Classes that are subclasses of `RuntimeException` and `Error` are categorized as unchecked exceptions, meaning the Java compiler does not enforce their handling or declaration.
In Java, checked exceptions are formally defined as any class that is a subclass of `java.lang.Exception`, with the specific exclusion of `java.lang.RuntimeException` and all its subclasses.
Concept tested: Java checked exception definition and characteristics
Source: https://docs.oracle.com/javase/tutorial/essential/exceptions/definition.html
Topics
Community Discussion
No community discussion yet for this question.