About Question enthuware.ocajp.i.v8.2.1222 :

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

Moderator: admin

Post Reply
olaska
Posts: 1
Joined: Wed Feb 15, 2017 6:33 pm
Contact:

About Question enthuware.ocajp.i.v8.2.1222 :

Post by olaska »

I have a problem to understand answer:" You cannot access class A's m1() from class C for the same object ( i.e. this)". Sorry, but english is not my native language and few times i got confused what you are asking for and what answer should be correct. Could you clarify this answer more detailed. First part is ok - it is not possible to access method m1() defined in class A - but what about object - if I declare reference type A - I should have an access to this method.

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

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

Post by admin »

"this" is a reference variable that points to the current instance of the same class in which it is used. For example, if you use this in class C's instance method, then "this" will refer to the same instance of class C.

In this option, it is asking you whether you can access A's m1 from C class's code using "this" reference. It is not possible.
If you like our products and services, please help us by posting your review here.


Post Reply

Who is online

Users browsing this forum: Google [Bot] and 77 guests