Page 1 of 1

About Question enthuware.ocpjp.v7.2.1224 :

Posted: Sat Aug 31, 2013 5:42 pm
by sinapse
Why a public variable can't be accessed from OUTSIDE the package com.enthu.qb?

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

Posted: Sun Sep 01, 2013 7:34 am
by admin
A public variable can be accessed from anywhere.

HTH,
Paul.

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

Posted: Sun Sep 01, 2013 12:56 pm
by sinapse
Exactly so the answer is wrong !

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

Posted: Sun Sep 01, 2013 1:11 pm
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?

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

Posted: Sun Sep 01, 2013 1:35 pm
by sinapse
It gave me the "public" answer as a wrong answer

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

Posted: Fri Sep 13, 2013 2:03 pm
by sinapse
No answer ?

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

Posted: Fri Sep 13, 2013 3:35 pm
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.

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

Posted: Fri Sep 13, 2013 4:30 pm
by sinapse
Def !

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

Posted: Fri Sep 13, 2013 5:30 pm
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 8485 times

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

Posted: Sat Sep 21, 2013 12:16 pm
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.