This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes Polymorphic Bean reference and Java polymorphism Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Reply locked New topic
Author

Polymorphic Bean reference and Java polymorphism

Rajat Sharmanaive
Ranch Hand

Joined: Jun 30, 2011
Posts: 41

Hi

I posted this mistakenly at a wrong forum. Hope to get some help this time. Learning through HFSJ by K&B. Following is my query from the same.

The jsp standard action:
In the generated servlet, translates to:

Following are my 2 beans:

But i notice that the reference variable personBean which is of the superclass type is able to access (and set) the subclass bean functions like setEmpId() which are not overridden. From previous knowledge I understand that dynamic dispatch happens only for overridden functions. Is eveything fine here. Please throw some light.

Sincerely hoping this time I have posted it correctly
Thanks


Rajat Sharma
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60800
    
  65

Please do not post the same question more than once. This topic is closed.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Polymorphic Bean reference and Java polymorphism
 
Similar Threads
value for the useBean class attribute Invalid Problem
examulator question error
Request to Bean
Is Polymorphic Bean reference in conformity with Java polymorphism
jsp:useBean doubt