what is overloading in java?
Answer Posted / sivaprasad addepalli
Method Overloading comes into picture when there are two
methods with same name but it must differ in one of the
follwing:
--> Number of arguments.
--> Datatype of arguments.
--> Order of the arguments.
for ex:
class sample
{
public:
void add (int a, int b)
{
}
void add (int a, int b, int c)
{
}
}
In this case the number of arguments are different so it is
method overloading.
Is This Answer Correct ? | 20 Yes | 3 No |
Post New Answer View All Answers
What is use of inner class in java?
What is a dynamic array java?
How do you use compareto method?
what is static import in java? Explain
What is the maximum size of a string in java?
What is the importance of hashcode() and equals() methods?
Differentiate jar and war files?
Write a java program for binary search?
How do you get length in java?
What is the use of keywords in java?
What is class level lock ?
What is runtime polymorphism or dynamic method dispatch?
What is final keyword in java? Give an example.
What is public/private protected in java?
What must a class do to implement an interface in java programming?