Top "Subclass" questions

A subclass is a class that derives or inherits from a parent (or super) class.

Import subclass from a base class in Python

I have a base class that has a method that creates an instance of a subclass that is called the …

python inheritance import subclass base
Overriding a parent class's methods

Something that I see people doing all the time is: class Man(object): def say_hi(self): print('Hello, World.…

python class methods subclass overriding
What is the difference between parent and base in Perl 5?

There appears to be a new pragma named parent that does roughly the same thing as base. What does parent …

perl subclass pragma
Subclass dict: UserDict, dict or ABC?

What's the difference between UserDict, dict and ABC and which one is recommended? The docs seem to deprecate UserDict? Also …

python subclass
How can I implement single table inheritance using Laravel's Eloquent?

Currently I have a model class named Post. class Post extends Eloquent { protected $table = 'posts'; protected $fillable = array('user_id', …

mysql inheritance laravel eloquent subclass
Swift 3: subclassing NSObject or not?

I have read some posts like this one about the difference between subclassing NSObject in Swift or just having its …

swift class inheritance subclass nsobject
Subclassing NSView to have a transparent background

I am creating an app where I need to have a transparent NSView with a transparent PNG image inside. The …

objective-c cocoa macos subclass nsview
How to "clone" an object into a subclass object?

I have a class A and a class B that inherits class A and extends it with some more fields. …

c# object copy subclass
Is it OK to have an empty method?

Is it OK to have an empty method and have it overridden in its subclass(es)? This is how it …

java oop subclass hierarchy chess
Delphi TListBox OnClick / OnChange?

Is there a trick to getting "OnChange" type of functionality with a TListBox? I can subclass the component and add …

delphi onclick subclass onchange tlistbox