A subclass can have its own private data members, so a subclass can also have its own constructors . The constructors of the subclass can initialize only the instance variables of the subclass. … To call a superclass constructor the super keyword is used.
Can a subclass have its own constructor?
A subclass can have its own private data members, so a subclass can also have its own constructors . The constructors of the subclass can initialize only the instance variables of the subclass. … To call a superclass constructor the super keyword is used.
Leave a Reply
Can a subclass have its own constructor?
A subclass can have its own private data members, so a subclass can also have its own constructors . The constructors of the subclass can initialize only the instance variables of the subclass. … To call a superclass constructor the super keyword is used.