A SuperClass is a class that holds the properties that can be used by all the other SubClasses and holds all the SubClasses, also it has it's own methodes that sub classes can inherit.
The SubClass inherits methods and properties from the main class (SuperClass) and can modify them to suit thier requirment but the main class cannot inherit methods or properties from the sub Class and sub classes can inherit from from other subClass, when you inherit and connect you need to set the constructor to match this class other wise it would refer to the main class or return undefined.
so in conclusion SuperClasses can live without SubClasses but the oppesite cannot happen.
No comments:
Post a Comment