SchweppesAle Posted December 10, 2009 Share Posted December 10, 2009 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 More sharing options...
trq Posted December 10, 2009 Share Posted December 10, 2009 Have you read http://www.phpfreaks.com/tutorial/oo-php-part-2-boring-oo-principles ? Link to comment https://forums.phpfreaks.com/topic/184610-polymorphism/#findComment-974586 Share on other sites More sharing options...
SchweppesAle Posted December 10, 2009 Author Share Posted December 10, 2009 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.