public class base{ public base(){ ///What ever } } public class sub extend base{ public sub(){ ///What ever } } } Is the call sub s=new sub(); call base class constructor even though there is no use in super()?
Valentin Crettaz
Gold Digger
Sheriff
Joined: Aug 26, 2001
Posts: 7610
posted
0
First, constructors are not inherited. Then, even if you do not explicitely invoke super(), the compiler adds it for you.
As long as default constructor ( Base() ) is not replaced with an over-loaded construct (e.g Base(String s). In that case, you have to explicitly call base constructor from sub constructor. Thanks Barkat