Top "Subclass" questions

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

Abstract classes in Swift Language

Is there a way to create an abstract class in the Swift Language, or is this a limitation just like …

inheritance abstract-class subclass swift
Why aren't superclass __init__ methods automatically invoked?

Why did the Python designers decide that subclasses' __init__() methods don't automatically call the __init__() methods of their superclasses, as …

python inheritance subclass delegation superclass
Swift subclassing - how to override Init()

I have the following class, with an init method: class user { var name:String var address:String init(nm: String, …

initialization swift subclass superclass
iOS: UIView subclass init or initWithFrame:?

I made a subclass of UIView that has a fixed frame. So, can I just override init instead of initWithFrame:? …

ios uiview uikit subclass init
Add rounded corners to all UIImageViews

I would like to add some rounded corners to all of the UIImageViews in my project. I have already got …

ios subclass code-reuse objective-c-category
When do you need to explicitly call a superclass constructor?

So say I have a subclass that extends a superclass. In what scenarios do I need to explicitly type super() …

java constructor subclass superclass
Is it possible to call subclasses' methods on a superclass object?

Animal is a superclass of Dog and Dog has a method called bark public void bark() { System.out.println("woof"); } …

java inheritance subclass superclass
How do you use the ellipsis slicing syntax in Python?

This came up in Hidden features of Python, but I can't see good documentation or examples that explain how the …

python numpy subclass slice ellipsis
Make Background of UIView a Gradient Without Sub Classing

Is there a way to make the background of a UIView a gradient without subclassing it? I'd rather not use …

iphone uiview subclass
Calling superclass from a subclass constructor in Java

I am trying to create a constructor that takes a field as a parameter, then puts it in a field …

java subclass superclass accessor