enthuware.ocajp.i.v8.2.1410

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
edgannon
Posts: 1
Joined: Sat May 21, 2016 2:13 pm
Contact:

enthuware.ocajp.i.v8.2.1410

Post by edgannon »

Hello,
I have a question about this answer explanation:
protected is also a valid way to encapsulate a field because only a subclass is able to inherit and access the field.

Protected allows subclasses and packages access, so is less restrictive than default access. The next explanation says:
No access modifer to age means it has default access i.e. all the members of the package can access it. This breaks encapsulation.

If that is true, then protected would also break encapsulation, correct?

Thank you,
Ed Gannon

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

Re: enthuware.ocajp.i.v8.2.1410

Post by admin »

You are right. I do not think protected should be a correct answer. Only private should be correct. Fixed.

thank you for your feedback!
Paul.
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 10 guests