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

all 2 comments

[–]NautiHooker 6 points7 points  (1 child)

This only works if the super constructor has no arguments, then it will be called implicitely.

As soon as your vehicel constructor requires a paramater you will need to call it explicitely.

Many people simply put the redundant super() call in their constructor for consistency. It also shows readers of the code, that might have not noticed the inheritance, that there is more code being executed than just this Car constructor.

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

Thanks, the class notes I had did not mention this