Results 1 to 7 of 7
Thread: Dynamic binding vs Polymorphism
- 09-29-2010, 07:45 PM #1
Member
- Join Date
- Sep 2010
- Posts
- 11
- Rep Power
- 0
- 09-29-2010, 07:54 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,385
- Blog Entries
- 7
- Rep Power
- 17
- 09-29-2010, 07:56 PM #3
Dynamic Binding is having two objects who are both parented by the same class but are of differing classes. They both have an extension of a method in their parent class, and when it is called ambiguously, either method can be called. Example:
Java Code:public class Human { public void SayHello() { // Empty } }Java Code:public class Man extends Human { @Override public void SayHello() { // Code for a man to say hi } }Java Code:public class Woman extends Human { public void SayHello() { // Code for a woman to say hi } }Java Code:public class SomeOtherClass { @Override public void SomeFunc(Human x) { x.SayHello(); } }
This is an example of a situation involving dynamic binding. Notice how the x object passed is a Human, but when SayHello() is called it will select the SayHello() pertinent to the object, be it a Human, Man, or Woman.
Polymorphism is a broader term that simply allows multiple object types (classes) to be handled by the same interface, such as having both Man and Woman be handled by Human. (Not really an interface in this case, but the same idea.)
Wikipedia can elaborate further. Best of luck!
- 09-29-2010, 08:08 PM #4
Member
- Join Date
- Sep 2010
- Posts
- 11
- Rep Power
- 0
thank you zack
- 04-27-2012, 02:33 PM #5
Member
- Join Date
- Apr 2012
- Posts
- 1
- Rep Power
- 0
Re: Dynamic binding vs Polymorphism
FYI, why make a forum when people just reply with is "google down?"
I googled this and ended up here, giving this site more attention, and it might have even been new members. After reading a moderator post a rude comment, I have deflected my interests elsewhere looking for a nicer, more mature community. Kthxbai

Kind regards,
ICodeUrMom
- 04-27-2012, 03:26 PM #6
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,385
- Blog Entries
- 7
- Rep Power
- 17
Re: Dynamic binding vs Polymorphism
When people rob a bank they get a penalty; when banks rob people they get a bonus.
- 04-28-2012, 01:37 AM #7
Member
- Join Date
- Apr 2012
- Posts
- 5
- Rep Power
- 0
Similar Threads
-
dynamic binding
By apparao in forum New To JavaReplies: 1Last Post: 02-16-2010, 08:41 AM -
Polymorphism Help
By AWPtic in forum New To JavaReplies: 5Last Post: 04-06-2009, 04:13 PM -
Dynamic Binding
By javarishi in forum New To JavaReplies: 3Last Post: 04-09-2008, 11:17 AM -
what is polymorphism
By Nari in forum New To JavaReplies: 5Last Post: 04-04-2008, 03:14 AM -
what's polymorphism?
By christina in forum New To JavaReplies: 2Last Post: 08-05-2007, 10:29 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks