[Advanced-java] OOP's Question
G.N.V. Jayprakash
gnvjp at hotmail.com
Fri Apr 27 07:27:17 PDT 2007
When I execute the program in Eclipse in debugging mode, I could see that the methodA() in A was being execute. But I could not follow exactly, that's why post the question.> Date: Fri, 27 Apr 2007 10:14:01 -0400> From: jaz at zukowski.net> To: advanced-java at lists.XCF.Berkeley.EDU> Subject: Re: [Advanced-java] OOP's Question> > > This is easy to answer. It is called println. Add one to each of the > methods and see which one is called.> > As far as Why.... Isn't that what homework is for, so you learn something?> > J> > Quoting "G.N.V. Jayprakash" <gnvjp at hotmail.com>:> > >> > 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?.> >> > _______________________________________________> Advanced-java mailing list> Advanced-java at lists.XCF.Berkeley.EDU> https://lists.XCF.Berkeley.EDU/mailman/listinfo/advanced-java
_________________________________________________________________
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/20070427/242ce981/attachment.html
More information about the Advanced-java
mailing list