Win a copy of OCP Oracle Certified Professional Java SE 11 Developer Practice Tests this week in the OCP forum!

Jens van Groeningen

Greenhorn
+ Follow
since Feb 19, 2021
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
1
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jens van Groeningen

Hi Jeanne,

I am doing the 'OCA / OCP Java SE 8 Programmer Practice Tests' using Wiley Efficient Learning.
A screenshot of how the question is displayed on Wiley Efficient Learning is attached.

Dear Jeanne,

The question states the following:

Which of the following statements about overriding a method is incorrect?
A. The return types must be covariant.
B. The access modifier of the method in the child class must be the same or broader than the method in the superclass.
C. A checked exception thrown by the method in the parent class must be thrown by the method in the child class.
D. A checked exception thrown by a method in the parent class must be the same or narrower than the exception thrown by the method in the child class.

And it states that the correct answer is C, and thus claiming that D (A checked exception thrown by a method in the parent class must be the same or narrower than the exception thrown by the method in the child class) is a valid statement, which it is not.
I just noted that I referenced the wrong errata page. This is the correct errata page for the test exam questions: https://www.selikoff.net/jpt/ that directed me to this forum 😁
Thank you!

I checked the following errata page: https://www.selikoff.net/java-oca-8-programmer-i-study-guide/

The error I discovered was not on this page and the page instructed me to post the error on this forum.
4 days ago
In this question it is stated that the following is correct:
'A checked exception thrown by a method in the parent class must be the same or narrower than the exception thrown by the method in the child class'

Which is absolutely incorrect because the inverse is true, namely:
'A checked exception thrown by a method in the parent class must be the same or BROADER than the exception thrown by the method in the child class'
5 days ago