My first introduction to programming was Java, which was horrible so I learnt Actionscript3 which was nice... "The point is" OOP was my introduction to programming where by I went on to gain a career ...

As I did understand, and as it's described here, ad-hoc polymorphism is limited to compile-time dispatch. That is, if we have a function that expects an argument that belongs to a typeclass, we must ...

I have been doing a lot of reading about polymorphism, inheritance and typing (specifically how it applies to Java).
I have seen some interesting examples, but not much explanation as to why.
I.e.:
...

Haskell supports overloaded values, where a single overloaded value can behave
sort of like a superposition of values each with a different type. For example, here's a simple type class:
class Truthy ...

I have two chat rooms, one has administration behaviour, and one doesn't. I have factored out all of the common code into a base chat room, but the AdministerChatroom behaviour I have pulled out into ...

I have a class SuperClass with two subclasses SubClassA and SubClassB. I have a method in a different class which takes a SuperClass parameter.
The method should do different things depending on the ...

Say in a game engine, you have Objects that composited of different components. One of these is a RenderComponent which can be either a Mesh, a Sprite or a Light.
Now, all these are vastly different ...

I'm a relative newcomer to OOP, and I'm having a bit of trouble creating good designs when it comes to interfaces.
Consider a class A with N public methods. There are a number of other classes, B, C, ...

My code is working on some compost relationship which creates a tree structure, class A has many children of type B, which has many children of type C etc. The lowest level class, call it bar, also ...

I read somewhere that the chain of inheritance breaks when you alter a behavior from derived class. What does "altering a behavior" mean here? Is overriding an already implemented method in base class ...

I'm working on an event processor framework for a simple game I'm writing, in which multiple types of events are handled in a loop. Since these events carry distinct pieces of data (i.e. one carries a ...

I am trying to better my understanding of polymorphism.
Say I have a base class called baseClass with one method called foo() and I have three derived classes called derived1 , derived2 and derived3 ...

I recently had a back and forth over at StackOverflow about my answer to this question.
The question was simple. The author wanted to transform a number into an abbreviated version that appended a K, ...

I can't figure out a better solution to my problem. I have a view controller that presents a list of elements. Those elements are models that can be an instance of B, C, D, etc and inherit from A. So ...

It was funny for me, and I'm interesting the reaction for this question of the community. It was interview for C++/Qt developer, and question was asked "What is virtual function". Not something like ...

I'm building an application in PHP, using Zend Framework 1 and Doctrine2 as the ORM layer. All is going well. Now, I happened to notice that both ZF1 and Doctrine2 come with, and rely on, their own ...

So I am reading up on python in Mark Lutz's wonderful LEARNING PYTHON book. Mark makes a big deal about how part of the python development philosophy is polymorphism and that functions and code should ...

When I first came to OOP (at first in Java, and then C++) after years of working in C and VB, it was amazing. The idea of extending existing behaviour and operating generically over things of related ...

At my company, we have many different "services" that work in parallel and send messages to each other using a common messaging system. All message objects are derived from a common generic object we ...