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 obtain a performance profile of java program
What is an iterator interface in java programming?
What are streams?
Can two objects have same hashcode?
What are static methods?
Is intellij better than eclipse?
What are the uses of java?
What is skeleton and stub?
What is the structure of java?
Is integer immutable in java?
How to provide security in java
Compare overloading and overriding?
What are internal variables?
What is an arraylist in java?
Why java is considered as platform independent?