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
How to sort array in descending order in java?
What are the important features of Java 9 release?
What are internal variables?
Outline the major features of java.
Should a main method be compulsorily declared in all java classes?
What is main function purpose?
What is meant by data hiding/encapsulation?
Why is it called a string?
Write a java program to check if a number is prime or not?
how can you take care of mutual exclusion using java threads? : Java thread
Explain about static nested classes in java?
Why is stringbuffer thread safe?
How we create object in copy constructor?
What is a string what operation can be performed out with the help of a string?
Which api is provided by java for operations on set of objects?