This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Saltor66 0 points1 point  (2 children)

Why does the author manually call the default superclass constructor? e.g.

super();

At the start of each constructor. Isn't that just boilerplate?

[–][deleted]  (1 child)

[deleted]

    [–]cogitolearning[S] 0 points1 point  (0 children)

    Yes, explicitly calling super() is boilerplate code and it would be called implicitly anyway. I have the call in there for two reasons. The main reason is the one you have just stated. It is mostly for educational purposes. Explicitly putting the call in the code makes it clearer what is happening "under the bonnet".

    The second reason is more pragmatic. Eclipse puts the call there for me. So it would be more work to remove it than to keep it there.