About Question enthuware.ocajp.i.v7.2.1359 :
Moderator: admin
Re: About Question enthuware.ocajp.i.v7.2.1359 :
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"?
-
- Site Admin
- Posts: 10053
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1359 :
What happened when you tried it out?
If you like our products and services, please help us by posting your review here.
-
- Posts: 202
- Joined: Mon Apr 02, 2018 8:40 am
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1359 :
What si the difference between hidden and shadowed variable?
-
- Site Admin
- Posts: 10053
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1359 :
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
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.
-
- Posts: 202
- Joined: Mon Apr 02, 2018 8:40 am
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1359 :
I read the word press article.
What is the difference between hidden variables and overriden method?
What is the difference between hidden variables and overriden method?
-
- Site Admin
- Posts: 10053
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1359 :
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.
-
- Posts: 202
- Joined: Mon Apr 02, 2018 8:40 am
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1359 :
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.
-
- Site Admin
- Posts: 10053
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1359 :
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.
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.
-
- Posts: 3
- Joined: Sat Mar 16, 2019 6:28 am
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1359 :
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?
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?
-
- Site Admin
- Posts: 10053
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1359 :
Yes.
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: No registered users and 34 guests