What is method Overloading in the perspective of OOPS?

Answer Posted / kabita

In same class more than two methods having same name but
different signatures are called method
overloading .signatures are
no of parameters,datatypes of parameters,sequence of
parameters.returntype may same or not.

ex:public int add(int a,int b)
{
S.o.p(a+b);
}
public int add(int a,int b,intc)
{
S.o.p(a+b+c);
}
public double add(double d,double e)
{
S.o.p(d+e);
}

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain 5 io best practices?

824


What are the limitations of procedural programming approach?

786


Does constructor be static?

804


What are the types of methods in java?

814


How to change value in arraylist java?

789


Does list allow duplicates in java?

715


When super keyword is used?

825


I want to persist data of objects for later use. What’s the best approach to do so?

727


Explain about static imports in java?

797


Can an arraylist be empty?

811


why java does not support unsigned keyword?

4741


Can we overload run() method in java?

894


What is stack class in java?

804


Differentiate between stringbuffer and string?

827


What does s mean in regex?

799