Page 1 of 1

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

Posted: Sat Jan 03, 2015 11:07 am
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"

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

Posted: Sat Jan 03, 2015 11:30 am
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.

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

Posted: Sat Jan 03, 2015 11:45 am
by hlosukwakha
Thank you

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

Posted: Tue Aug 16, 2016 3:15 am
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

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

Posted: Tue Aug 16, 2016 6:22 am
by admin
No, there is no such implication. You just need to consider what is written in the option.
HTH,
Paul.