Possible Duplicate:
Why does this() and super() have to be the first statement in a constructor?
I just learned that at school, but the teacher doesn't know why.
I can think of some good reasons, but I think there are cases when the initializing can be done later in the constructor- before you use the variables form the mother class, for example. OK, the variables should be initialized from the start, but that's not always necessary.
I"m guessing there are a more reasons for that why must super() be placed in the first line of the constructor.
So, why must I write super() in the first line of the constructor, when I'm inheriting a class?
No comments:
Post a Comment