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.

Polymorphism with gson

I have a problem deserializing a json string with Gson. I receive an array of commands. The command can be …

java json polymorphism gson deserialization
Method accepting two different types as parameter

I am writing a method that should accept as its parameter an object of one of two types which do …

java generics polymorphism overloading
Polymorphism in C++

AFAIK: C++ provides three different types of polymorphism. Virtual functions Function name overloading Operator overloading In addition to the above …

c++ polymorphism c++-faq
How are virtual functions and vtable implemented?

We all know what virtual functions are in C++, but how are they implemented at a deep level? Can the …

c++ polymorphism virtual-functions vtable
How to resolve "pure virtual method called"

I understand why this is happening, but I'm stuck trying to resolve it...here is what my code is doing …

c++ polymorphism derived-class base-class pure-virtual
virtual function call from base class

Say we have: Class Base { virtual void f(){g();}; virtual void g(){//Do some Base related code;} }; Class Derived : public …

c++ polymorphism virtual
Inject spring bean dynamically

In a java-spring web-app I would like to be able to dynamically inject beans. For example I have an interface …

java spring polymorphism spring-environment
Scala: How to define "generic" function parameters?

I am trying to learn Scala now, with a little bit of experience in Haskell. One thing that stood out …

scala haskell polymorphism type-inference
How can I store objects of differing types in a C++ container?

Is there a C++ container that I could use or build that can contain, say, int and string and double …

c++ types polymorphism containers
Does instanceof return true if instance of a parent?

I have a class Child that extends Parent. Parent child = new Child(); if (child instanceof Parent){ // Do something } Does this …

java oop inheritance polymorphism instanceof