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
design an lru cache in java?
Explain, java is compatible with all servers but not all browsers?
What is thread count in java?
What is difference between java and java ee?
Can we sort a map in java?
What is the finalize method do?
Does sprintf add a null terminator?
What are the java ide’s?
Is list thread safe in java?
What is the replace tool?
Why static functions are used?
How many types of exception can occur in a java program?
What is java command?
Can an unreferenced object be referenced again?
What is methodological theory?