Top "Polymorphism" questions

In computer science, polymorphism is a programming language feature that allows values of different data types to be handled in a uniform manner.

How does Java Object casting work behind the scene?

Possible Duplicate: How does the Java cast operator work? Java casting implementation I am always wondering how object casting works …

java casting polymorphism
Return dynamic table with unknown columns from PL/pgSQL function

I need to create a function that checks on a given table if the infowindow field exists. If it exists …

postgresql polymorphism plpgsql dynamic-sql return-type
Why does Haskell's `head` crash on an empty list (or why *doesn't* it return an empty list)? (Language philosophy)

Note to other potential contributors: Please don't hesitate to use abstract or mathematical notations to make your point. If I …

haskell polymorphism parametric-polymorphism
c++ standard practice: virtual interface classes vs. templates

I have to make a decision regarding generalization vs polymorphism. Well the scenario is standard: I want to make my …

c++ templates coding-style polymorphism
templates may not be ‘virtual’

Given the code below, the compiler is showing a message pointing that error: templates may not be ‘virtual’. Does anyone …

c++ templates polymorphism virtual
Polymorphic factory / getInstance() in Java

I'm aiming to create a set of objects, each of which has a unique identifier. If an object already exists …

java design-patterns polymorphism factory
How to call super method when overriding a method through a trait

It would appear that it is possible to change the implementation of a method on a class with a trait …

scala polymorphism mixins traits
C++ abstract class without pure virtual functions?

I have a base class class ShapeF { public: ShapeF(); virtual ~ShapeF(); inline void SetPosition(const Vector2& inPosition) { mPosition.Set(…

c++ polymorphism abstract-class pure-virtual
Rails joins or preload belongs_to association from polymorphic model

my problem is following. How can I joins belongs_to association from polymorphic model There is situation opinion.rb class …

ruby-on-rails activerecord join preload polymorphism
Are references and pointers equal with regards to polymorphism?

I always think of having to use pointers for polymorphism. Using the canonical example: DrawEngine::render(Shape *shape) { shape->…

c++ reference polymorphism