Jump to content

Polymorphism


SchweppesAle

Recommended Posts

Was wondering if someone could explain this a little better to me.  I had always assumed that it had to do with method overloading or overriding(through inheritence). 

 

The following wikipedia entry seems to indicate otherwise though:

 

http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming

 

"Polymorphism is not the same as method overloading or method overriding. [1] Polymorphism is only concerned with the application of specific implementations to an interface or a more generic base class. Method overloading refers to methods that have the same name but different signatures inside the same class. Method overriding is where a subclass replaces the implementation of one or more of its parent's methods. Neither method overloading nor method overriding are by themselves implementations of polymorphism"

Link to comment
https://forums.phpfreaks.com/topic/184610-polymorphism/
Share on other sites

pretty nice tutorial but...again, it looks to me like you're explaining polymorphism through method overriding(a result of inheritance).

 

I feel like I just don't understand the following statement:

 

"Polymorphism is not the same as method overloading or method overriding. [1] Polymorphism is only concerned with the application of specific implementations to an interface or a more generic base class. Method overloading refers to methods that have the same name but different signatures inside the same class. Method overriding is where a subclass replaces the implementation of one or more of its parent's methods. Neither method overloading nor method overriding are by themselves implementations of polymorphism"

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/184610-polymorphism/#findComment-974591
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.