posted 24 years ago
hi,there:
/////////////////////////////////////////////////
i have a question derived out of ur answers.
so the question is about overriding and the answer 2 becomes a totally different method in a subclass. Is answer 3 not a new method in the subclass as it has a argument.
////////////////////////////////////////////////
Answer 2 is not legal, because only with different return type are not considered as Overloading or Overriden. The compiler will not let you pass if you write code like answer 2.
Answer 3 is not a new method in the subclass as it has a argument but it is the overloading version of base class.
Feel free to conrect me. Thanks.