Inherit constructor in java

preview_player
Показать описание
In Java, constructor of base class with no argument gets automatically called in derived class constructor. For example, output of following program is:

Base Class Constructor Called
Derived Class Constructor Called

if we want to call parameterized contructor of base class, then we can call it using super(). The point to note is base class comstructor call must be the first line in derived class constructor.
Рекомендации по теме
visit shbcf.ru