About Question enthuware.ocajp.i.v8.2.1330

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
corptrainer1
Posts: 5
Joined: Mon Oct 03, 2016 3:41 am
Contact:

About Question enthuware.ocajp.i.v8.2.1330

Post by corptrainer1 »

A student submitted the following:

Please see the attached file. Answer option D is, in fact, correct. Classes outside of the package cannot see the class, so there can be NO subclasses that exist outside of the package. The question does not specify that the subclasses must be able to exist outside the package. Based on both of these facts, all subclasses of a class with default access can access the classes method.
Attachments
enthuware.ocajp.i.v8.2.1330_screencast.png
enthuware.ocajp.i.v8.2.1330_screencast.png (154.41 KiB) Viewed 1875 times

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

Re: About Question enthuware.ocajp.i.v8.2.1330

Post by admin »

The given answer is correct. The access control that is being talked about in the question is for the method. Not for the class. The question does not specify access control on the class. So you need to consider all possibilities. What if the class is public and you don't specify any access control keyword on the method?

-Paul.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests