[HD Pg 316, Sec. 9.2.3 - impact-of-access-modifiers-on-abstract-and-final]

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
Username987654
Posts: 95
Joined: Sat Dec 26, 2015 6:37 pm
Contact:

[HD Pg 316, Sec. 9.2.3 - impact-of-access-modifiers-on-abstract-and-final]

Post by Username987654 »

What if the recline method were protected or default? It would have been ok in that case because it is possible for a subclass to inherit methods with protected and default access.
I think that the text may be "isolating concerns" here, but I would respectfully argue that "some" may be perplexed when they see:

$javac Sofa.java
Sofa.java:1: error: Sofa is not abstract and does not override abstract method recline() in Sofa
public class Sofa{
^
1 error

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: [HD Pg 316, Sec. 9.2.3 - impact-of-access-modifiers-on-abstract-and-final]

Post by admin »

You are right. It should be declared abstract. Added to errata.
thank you for your feedback!
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 23 guests