Top "Base-class" questions

In Object Oriented Programming, a base class is one from which other classes inherit.

Creating a singleton in Python

This question is not for the discussion of whether or not the singleton design pattern is desirable, is an anti-pattern, …

python singleton decorator base-class metaclass
Does delete on a pointer to a subclass call the base class destructor?

I have an class A which uses a heap memory allocation for one of its fields. Class A is instantiated …

c++ memory-management destructor delete-operator base-class
Interface vs Base class

When should I use an interface and when should I use a base class? Should it always be an interface …

oop interface language-agnostic base-class static-typing
Is it possible to assign a base class object to a derived class reference with an explicit typecast?

Is it possible to assign a base class object to a derived class reference with an explicit typecast in C#?. …

c# casting derived-class base-class downcast
How to hide an inherited property in a class without modifying the inherited class (base class)?

If i have the following code example: public class ClassBase { public int ID { get; set; } public string Name { get; set; } } …

c# inheritance properties base-class
Will the base class constructor be automatically called?

class Person { public int age; public Person() { age = 1; } } class Customer : Person { public Customer() { age += 1; } } Customer customer = new Customer(); Would the …

c# constructor base-class
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
C# Class naming convention: Is it BaseClass or ClassBase or AbstractClass

What is the recommended approach to naming base classes? Is it prefixing the type name with "Base" or "Abstract" or …

c# naming-conventions base-class
How do I call a derived class method from the base class?

I have read several similar questions about this but none seem to solve the problem I am facing. The typical …

c# derived-class base-class
Cast base class to derived class python (or more pythonic way of extending classes)

I need to extend the Networkx python package and add a few methods to the Graph class for my particular …

python inheritance derived-class base-class