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.

The inheritance of attributes using __init__

I'm Java person who just started learning Python. Take this example: class Person(): def __init__(self, name, phone): self.name = …

python inheritance attributes polymorphism
What is the difference between Abstraction and Polymorphism

I seem to not understand two OOP concepts very well. Could you explain what abstraction and polymorphism are, preferably with …

oop polymorphism abstraction
Can't downcast because class is not polymorphic?

Is it possible to have inheritance with no virtual methods? The compiler is saying that the following code is not …

c++ inheritance polymorphism vtable
Can I override a private method in Java?

I know I can use reflection to invoke a private method, and to get or set the value of a …

java reflection polymorphism access-modifiers
Best way to declare an interface in C++11

As we all know, some languages have the notion of interfaces. This is Java: public interface Testable { void test(); } How …

c++ interface c++11 polymorphism abstract
Is VBA an OOP language, and does it support polymorphism?

I am actually working on my first VBA project. (come from C++) I would like to improve an existing VBA …

excel vba oop polymorphism
Must ASP.NET MVC Controller Methods Return ActionResult?

Being new to ASP.NET MVC, I've been wondering about the signature of Controller methods. In all the examples I've …

asp.net-mvc polymorphism actionresult viewresult
Default implementation or abstract method?

Is it better to put a default implementation of a method in a superclass, and override it when subclasses want …

java polymorphism default abstract-methods
If-less programming (basically without conditionals)

I've had a colleague that told me he once worked for a company that had as a policy to never …

oop polymorphism conditional
When to use enums, and when to replace them with a class with static members?

It recently occured to me that the following (sample) enumeration... enum Color { Red, Green, Yellow, Blue } ... could be replaced with …

c# enums polymorphism static-members