Note: If a constructor does not explicitly invoke a superclass constructor, the Java compiler automatically inserts a call to the no-argument constructor of the superclass. If the super class does not have a no-argument constructor, you will get a compile-time error. Object does have such a constructor, so if Object is the only superclass, there is no problem.
I don't like it when people add an explicit super() call (with no arguments), because it is superfluous:
If the superclass does not have a no-arguments constructor, then you must explicitly call super(arguments) in each subclass constructor.
Simply: yes. You must initialise all the fields, so as to create your instance in a consistent state, ie fulfilling its class invariants. The only instance where you can get away without a super(...); call is if the superclass has an accessible no-arguments constructor. One must presume that constructor will put the superclass object into a consistent state.
I think the only state in which case it is good design not to initialise the fields in the superclass is when the superclass hasn't got any fields!
girl power ... turns out to be about a hundred watts. But they seriuosly don't like being connected to the grid. Tiny ad:
The WEB SERVICES and JAX-RS Coursehttps://coderanch.com/t/690789/WEB-SERVICES-JAX-RS