+ 3

What is a superclass?

31st May 2018, 8:51 PM
Salsabila Abdulhalim
3 Answers
+ 20
Super class (parent class, base class) is one class that another class(es) has extended it to add properties/functionalities to it. Concrete classes (drived class, child class) inherit from the superclass. https://www.sololearn.com/discuss/836658/?ref=app
31st May 2018, 10:49 PM
Amir
Amir - avatar
+ 7
Inheritance is a relationship between two classes such that one is a subclass of the other — this other one is called a superclass of the first one. For example, you may have an Animal class, which contains all the information and behavior that an Animal object should have. Then you can create a Dog class. Of course, a Dog is a subtype of Animal, so the Dog class should be a subclass of Animal. Then you say that the Animal class is a superclass of Dog.
31st May 2018, 8:56 PM
Pedro Demingos
Pedro Demingos - avatar
+ 6
class A {} class B extends A {} A is the superclass of B in this example.
31st May 2018, 8:56 PM
Elmer Martens
Elmer Martens - avatar