[Advanced-java] OOP's Question
uddipan.bagchi at wipro.com
uddipan.bagchi at wipro.com
Fri Apr 27 08:40:49 PDT 2007
methodA() of A will be invoked. Try it out!!
--------------------------
Sent from my BlackBerry Wireless Handheld
-----Original Message-----
From: advanced-java-bounces at lists.XCF.Berkeley.EDU <advanced-java-bounces at lists.XCF.Berkeley.EDU>
To: advanced-java at lists.xcf.berkeley.edu <advanced-java at lists.xcf.berkeley.edu>
Sent: Fri Apr 27 15:07:59 2007
Subject: [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! <http://www.live.com/getstarted.aspx>
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.
WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
www.wipro.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /lists/advanced-java/attachments/20070427/de9d6631/attachment.html
More information about the Advanced-java
mailing list