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 do you mean by jjs in java8?
Does java have extension methods?
Can you override private or static method in java?
What does split function do in java?
What will happen to the exception object after exception handling?
What is the driver class?
What is difference between hashset and hashmap?
Explain the significance of listiterator.
What is meant by method overriding?
Is it possible to use string in the switch case?
Write a java program to check if a number is prime or not?
Is age a discrete variable?
What's the difference between comparison done by equals method and == operator?
What is api in java?
Explain the access modifiers for a class, method and variables?