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.

Re-raise exception with a different type and message, preserving existing information

I'm writing a module and want to have a unified exception hierarchy for the exceptions that it can raise (e.…

python exception-handling polymorphism
How can I simulate OO-style polymorphism in C?

Is there a way to write OO-like code in the C programming language? See also: Can you write object-oriented code …

c oop polymorphism
Why does an overridden function in the derived class hide other overloads of the base class?

Consider the code : #include <stdio.h> class Base { public: virtual void gogo(int a){ printf(" Base :: gogo (int) \…

c++ polymorphism overriding
How does polymorphism work in Python?

I'm new to Python... and coming from a mostly Java background, if that accounts for anything. I'm trying to understand …

python polymorphism
What does 'has virtual method ... but non-virtual destructor' warning mean during C++ compilation?

#include <iostream> using namespace std; class CPolygon { protected: int width, height; public: virtual int area () { return (0); } }; class CRectangle: …

c++ polymorphism virtual
Store derived class objects in base class variables

I would like to store instances of several classes in a vector. Since all classes inherit from the same base …

c++ polymorphism object-slicing
Will GetType() return the most derived type when called from the base class?

Will GetType() return the most derived type when called from the base class? Example: public abstract class A { private Type …

c# inheritance polymorphism
Run an Application in GDB Until an Exception Occurs

I'm working on a multithreaded application, and I want to debug it using GDB. Problem is, one of my threads …

c++ debugging gdb polymorphism multicore
python properties and inheritance

I have a base class with a property which (the get method) I want to overwrite in the subclass. My …

python inheritance properties polymorphism
Do subclasses inherit interfaces?

Quick question, I'm learning about interfaces and inheritance. This is not actual code, just an example. Let's say I have …

java polymorphism