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 the purpose class.forname method?
What is the replace tool?
Differentiate between array list and vector in java.
What is incompatible types in java?
What are the wrapped, classes?
What is a function in java?
What is meant by class loader? How many types are there? When will we use them?
What is the difference between class & structure?
What is the purpose of the enableevents() method in java programming?
Can memory leak happen java?
Why convert an applet to an application?
What are byte codes?
Explain different ways of creating a thread?
How does multithreading take place on a computer with a single cpu in java programming?
Where pragma is used?