java - Does superclass constructor exist (but not inherited) in subclass? -
we able invoke super() subclass constructor. since subclass is-a superclass , , there 1 object created ( new subclass()) imply superclass constructor exists, although cannot inherited, in subclass?
constructors not inherited. superclass constructor 'exists' in way call subclass unless it's marked private
.
and i.k. has mentioned class have default constructor:
if class contains no constructor declarations, default constructor no formal parameters , no throws clause implicitly declared.
Comments
Post a Comment