Top "Subclass" questions

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

Subclassing NSObject in Swift - Best Practice with Initializers

Here is the layout of an example Class, can someone guide me on what's best practice when creating a subclass …

ios swift initialization subclass nsobject
Changing the value of superclass instance variables from a subclass

I've found that I can do it this way in the child class: ParentClass.variable = value; But I've been told …

java inheritance subclass superclass
Programmatically create UICollectionView with custom headers

I'm making an iOS app in swift, and I'm trying to make a collectionView programmatically. I want to use my …

ios swift uicollectionview subclass
Test whether a Ruby class is a subclass of another class

I would like to test whether a class inherits from another class, but there doesn't seem to exist a method …

ruby inheritance subclass superclass
python subclass access to class variable of parent

I was surprised to to learn that a class variable of a subclass can't access a class variable of the …

python subclass class-variables
Subclassing Python dictionary to override __setitem__

I am building a class which subclasses dict, and overrides __setitem__. I would like to be certain that my method …

python dictionary subclass
Inheritance in Java - creating an object of the subclass invokes also the constructor of the superclass. Why exactly?

I have a question about inheritance in Java. I have two classes A and B , and class B, inherits from …

java inheritance constructor subclass
Java -- Initializing superclass variables in subclasses?

Okay, so, for example, let's say I have an abstract class called "Vehicle". The Vehicle class, has, among other things, …

java variables subclass superclass
Why subclass in another package cannot access a protected method?

I have two classes in two different packages: package package1; public class Class1 { public void tryMePublic() { } protected void tryMeProtected() { } } package …

java package subclass protected modifier
Swift - UIButton overriding setSelected

I'm making a UIButton subclass in Swift to perform custom drawing and animation on selection What would be the equivalent …

ios swift uibutton subclass