The question is: "An overriding method can declare ArithmeticException in its throws clause even if the overridden method does not have any throws clause" (true/false).
The answer is "Since ArithmeticException is a RuntimeException. Any method can throw it without declaring it in its throws clause.".
I feel like the answer is not related to the question. The question is about what you can put in a throws clause (relative to its super method), but the answer is not concerned with that. It simply says you can throw a runtime exception whenever.
About Question enthuware.ocpjp.v8.2.1319 :
Moderators: Site Manager, fjwalraven
-
- Posts: 1
- Joined: Mon Aug 31, 2020 9:59 am
- Contact:
-
- Site Admin
- Posts: 10322
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1319 :
The question is not a general question about throws cluase. It is very specific. It is about whether you can have ArithmeticExcpetion in a throws clause in an overriding method. The explanation correctly explains why that is ok.
Even so, we will enhance the explanation to make it better.
thank you for your feedback.
Even so, we will enhance the explanation to make it better.
thank you for your feedback.
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: Google [Bot] and 5 guests