next up previous
Next: Inherited methods and variables Up: Unit 08 Previous: Constructor of a derived

Use of super()

In general, when the subclass has its own instance variables, its constructor must first construct an object of the superclass (using super()) and then construct its own instance variables.

Note:


next up previous
Next: Inherited methods and variables Up: Unit 08 Previous: Constructor of a derived