[Advanced-java] OOP's Question
G.N.V. Jayprakash
gnvjp at hotmail.com
Wed May 2 07:52:57 PDT 2007
Thanks for the reponses.
I think the object on which the methodA() is being invoked is an object of A. That's why the methodA() of A was executed.
But the code suggesting that an object of A was being invoked upon is not very obvious.
Jayprakash
From: gnvjp at hotmail.comTo: advanced-java at lists.xcf.berkeley.eduDate: Fri, 27 Apr 2007 14:07:59 +0000Subject: [Advanced-java] OOP's Question
Hi, I have a question in Object Oriented Programming: A extends B. B extends C. There is a public method methodA() implemented in C. methodA() is also overridden in A. There is a flow starting from A from preProcessRequest() implemented in A. preProcessRequest() is also implemented in B. Now preProcessRequest() in A invokes super.preProcessRequest(). The control goes to the preProcessRequest() in B.preProcessRequest() method implementation in B invokes methodA(). Now the question is: Will the methodA() implemented in C will be invoked or the methodA() implemented in A will be invoked? Why?. Thanks & Regards,Jayprakash
Get news, entertainment and everything you care about at Live.com. Check it out!
_________________________________________________________________
Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /lists/advanced-java/attachments/20070502/c5918a23/attachment.html
More information about the Advanced-java
mailing list