When the parent class have an add method with 2 parameters, If we add new add method with 3 parameters in child class, shall we call this as over loading?
Thanks in advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, since the method with two parameters is inherited by the subclass, the method with three parameters is said to be an overloading method.
A quote from the official trail on Overriding and Hiding Methods:
(As you probably already figured out, the method with three classes is not an overriding method.)