According to my text book:
If the execution of any constructor in a subclass does not invoke a
superclass constructor, Java automatically invokes the no-parameter
constructor for the superclass.
Does that mean all the superclass data field(superclass variables) would be set to null(because the constructor is a no-parameter constructor)?
No, if the
supers constructor with no arguments initializes some objects – this initialization will be done.The
B‘s constructor will still invokesuper()as the first line (even though it is not explicitly written), and will initializex=1in the process.