About Question enthuware.ocpjp.v7.2.1224 :

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

Moderator: admin

Post Reply
sinapse
Posts: 27
Joined: Sat Aug 31, 2013 5:38 pm
Contact:

About Question enthuware.ocpjp.v7.2.1224 :

Post by sinapse »

Why a public variable can't be accessed from OUTSIDE the package com.enthu.qb?

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

Re: About Question enthuware.ocpjp.v7.2.1224 :

Post by admin »

A public variable can be accessed from anywhere.

HTH,
Paul.
If you like our products and services, please help us by posting your review here.

sinapse
Posts: 27
Joined: Sat Aug 31, 2013 5:38 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1224 :

Post by sinapse »

Exactly so the answer is wrong !

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

Re: About Question enthuware.ocpjp.v7.2.1224 :

Post by admin »

I am not sure I understand your point. Which answer is wrong? The question says, "which member variables are accessible from OUTSIDE the package com.enthu.qb?"

j is a public field so it is accessible. What is the issue?
If you like our products and services, please help us by posting your review here.

sinapse
Posts: 27
Joined: Sat Aug 31, 2013 5:38 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1224 :

Post by sinapse »

It gave me the "public" answer as a wrong answer

sinapse
Posts: 27
Joined: Sat Aug 31, 2013 5:38 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1224 :

Post by sinapse »

No answer ?

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

Re: About Question enthuware.ocpjp.v7.2.1224 :

Post by admin »

I tried it and it shows public as correct answer. Can you please confirm that you saw this as wrong answer?

thank you,
Paul.
If you like our products and services, please help us by posting your review here.

sinapse
Posts: 27
Joined: Sat Aug 31, 2013 5:38 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1224 :

Post by sinapse »

Def !

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

Re: About Question enthuware.ocpjp.v7.2.1224 :

Post by admin »

Not sure why you saw that. Attached is what I see. Can you please download the latest version of the question bank? ( 1.48)
2.1224.png
2.1224.png (30.26 KiB) Viewed 7291 times
If you like our products and services, please help us by posting your review here.

Student
Posts: 53
Joined: Fri Sep 20, 2013 7:20 am
Contact:

Re: About Question enthuware.ocpjp.v7.2.1224 :

Post by Student »

sinapse wrote:Exactly so the answer is wrong !
You have to look first at class visibility, then at member visibility. If the class isn't visible, none of its members will be visible, regardless of their access specifier.

Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests