filmov
tv
A Level : OOP : Child class constructors
Показать описание
A Level Computer Science - Child class constructors
Child classes inherit all of the fields/attributes of the parent class. Parent and child relationships are sometimes known as super and sub-class relationships.
To create a child/subclass we must call the parent/super class constructor. By calling the parent/super class constructor the child/subclass will inherit the fields/attributes of the parent/super class.
Attention is to be taken to ensure the parameters of the child/subclass are identical to that of the parent/super class, and then the attributes of the child/subclass should be listed.
Child classes inherit all of the fields/attributes of the parent class. Parent and child relationships are sometimes known as super and sub-class relationships.
To create a child/subclass we must call the parent/super class constructor. By calling the parent/super class constructor the child/subclass will inherit the fields/attributes of the parent/super class.
Attention is to be taken to ensure the parameters of the child/subclass are identical to that of the parent/super class, and then the attributes of the child/subclass should be listed.