About Question enthuware.ocajp.i.v7.2.1343 :

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

Moderator: admin

Post Reply
hlosukwakha
Posts: 3
Joined: Thu Jan 01, 2015 1:14 pm
Contact:

About Question enthuware.ocajp.i.v7.2.1343 :

Post by hlosukwakha »

Good day. I don't understand the difference between:
"main cannot access this.x as it is declared now" and "By declaring x as static, main can access this.x"

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

Re: About Question enthuware.ocajp.i.v7.2.1343 :

Post by admin »

"main cannot access this.x as it is declared now" means the way x is declared currently in the given code, you cannot access it from main.

"By declaring x as static, main can access this.x" means if you make x static main can do this.x. : This is a wrong option because the statement is wrong. Even if you make x static, you cannot do this.x.

HTH,
Paul.

hlosukwakha
Posts: 3
Joined: Thu Jan 01, 2015 1:14 pm
Contact:

Re: About Question enthuware.ocajp.i.v7.2.1343 :

Post by hlosukwakha »

Thank you

ioannis.liakis
Posts: 1
Joined: Tue Aug 16, 2016 3:04 am
Contact:

Re: About Question enthuware.ocajp.i.v7.2.1343 :

Post by ioannis.liakis »

Guys , I disagree with the correct answer.
As stated right now, it implies that there is a way (if you change the declaration of x) to access this.x from main.

Please let me know of your opinion

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

Re: About Question enthuware.ocajp.i.v7.2.1343 :

Post by admin »

No, there is no such implication. You just need to consider what is written in the option.
HTH,
Paul.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests