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

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

Moderator: admin

Post Reply
Deleted User 3513

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

Post by Deleted User 3513 »

It is not possible to cast the keywords this and super, right? Just like what was done in option 1? And it would specifically give out an error saying "not a statement"?

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

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

Post by admin »

What happened when you tried it out?
If you like our products and services, please help us by posting your review here.

flex567
Posts: 202
Joined: Mon Apr 02, 2018 8:40 am
Contact:

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

Post by flex567 »

What si the difference between hidden and shadowed variable?

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

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

Post by admin »

Try this: https://techsymphony.wordpress.com/2011 ... g-in-java/
or in Hanumant's book, shadowing is explained in section 3.4.2 under "When is this necessary" heading and hiding is explained in section 11.1.2
If you like our products and services, please help us by posting your review here.

flex567
Posts: 202
Joined: Mon Apr 02, 2018 8:40 am
Contact:

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

Post by flex567 »

I read the word press article.
What is the difference between hidden variables and overriden method?

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

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

Post by admin »

flex567 wrote:
Wed Dec 26, 2018 6:22 am
I read the word press article.
What is the difference between hidden variables and overriden method?
Not sure what kind of difference are you looking for. One is a variable and one is a method. There is nothing like "overridden variable" if that is what you are asking.

Also, the questions that you are asking are too basic. You really should read a book from first page to the last page very carefully and very patiently. Only that can set your fundamentals straight.
If you like our products and services, please help us by posting your review here.

flex567
Posts: 202
Joined: Mon Apr 02, 2018 8:40 am
Contact:

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

Post by flex567 »

I think some fundamental concepts are not well explain in most of the books and then you learn about it only from these exam questions(answers) .
Last edited by flex567 on Wed Dec 26, 2018 8:11 am, edited 1 time in total.

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

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

Post by admin »

That is possible.
BTW, overriding and hiding are explained in detail in Section 11.1.2 of Hanumant's book. Let me know which part is not clear so that we can improve it.
If you like our products and services, please help us by posting your review here.

gaborj
Posts: 3
Joined: Sat Mar 16, 2019 6:28 am
Contact:

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

Post by gaborj »

hi Admin,

slightly modified version of fasty23's :
class C extends B {
public void perform_work(){ }
public void instanceMethod() {
A a = new A();
a.perform_work();
}
}

In this context the a's perform_work method is called from C's instance method, isn't it?

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

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

Post by admin »

gaborj wrote:
Wed Mar 27, 2019 6:22 pm
hi Admin,

slightly modified version of fasty23's :
class C extends B {
public void perform_work(){ }
public void instanceMethod() {
A a = new A();
a.perform_work();
}
}

In this context the a's perform_work method is called from C's instance method, isn't it?
Yes.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 34 guests