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.

Why use base class pointers for derived classes

class base{ ..... virtual void function1(); virtual void function2(); }; class derived::public base{ int function1(); int function2(); }; int main() { derived d; …

c++ oop polymorphism virtual-functions base-class
Reintroducing functions in Delphi

What was the motivation for having the reintroduce keyword in Delphi? If you have a child class that contains a …

delphi oop polymorphism
When is a vtable created in C++?

When exactly does the compiler create a virtual function table? 1) when the class contains at least one virtual function. OR 2) …

c++ polymorphism virtual-functions vtable
How to have abstract and overriding constants in C#?

My code below won't compile. What am i doing wrong? I'm basically trying to have a public constant that is …

c# polymorphism constants
Inheritance Mapping with Fluent NHibernate

Given the following scenario, I want map the type hierarchy to the database schema using Fluent NHibernate. I am using …

nhibernate mapping types fluent polymorphism
Parametric polymorphism vs Ad-hoc polymorphism

I would like to understand the key difference between parametric polymorphism such as polymorphism of generic classes/functions in the …

java haskell types polymorphism type-inference
Force base method call

Is there a construct in Java or C# that forces inheriting classes to call the base implementation? You can call …

c# java inheritance polymorphism super
Laravel: Returning the namespaced owner of a polymorphic relation

I can find a number of discussions regarding this but no clear solution. Here are two links, although I will …

laravel laravel-4 polymorphism eloquent
Compiler error : reference to call ambiguous

Case 1 static void call(Integer i) { System.out.println("hi" + i); } static void call(int i) { System.out.println("hello" + …

java methods polymorphism java-7 boxing
Is polymorphism possible without inheritance?

In an interview I was asked if polymorphism can be achieved without inheritance. Is this possible?

java oop inheritance polymorphism