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.

When to use virtual destructors?

I have a solid understanding of most OOP theory but the one thing that confuses me a lot is virtual …

c++ polymorphism shared-ptr virtual-destructor
What is the main difference between Inheritance and Polymorphism?

I was presented with this question in an end of module open book exam today and found myself lost. I …

java oop inheritance polymorphism
Polymorphism vs Overriding vs Overloading

In terms of Java, when someone asks: what is polymorphism? Would overloading or overriding be an acceptable answer? I think …

java oop polymorphism overloading overriding
In Java, how do I call a base class's method from the overriding method in a derived class?

I have two Java classes: B, which extends another class A, as follows : class A { public void myMethod() { /* ... */ } } class B …

java inheritance methods polymorphism
What is the difference between dynamic and static polymorphism in Java?

Can anyone provide a simple example that explains the difference between Dynamic and Static polymorphism in Java?

java oop polymorphism overloading overriding
Check if an object belongs to a class in Java

Is there an easy way to verify that an object belongs to a given class? For example, I could do …

java polymorphism
Jump into interface implementation in Eclipse IDE

You know how in Eclipse, pressing F3 over a method will take you to its declaration? Well I have a …

eclipse interface polymorphism
List<Map<String, String>> vs List<? extends Map<String, String>>

Is there any difference between List<Map<String, String>> and List<? extends Map<String, …

java generics inheritance polymorphism
Is List<Dog> a subclass of List<Animal>? Why are Java generics not implicitly polymorphic?

I'm a bit confused about how Java generics handle inheritance / polymorphism. Assume the following hierarchy - Animal (Parent) Dog - …

java generics inheritance polymorphism