Home > Method Overloading

Method overloading in Java – Part 1

What is method overloading in Java?If two or more methods in a class have same name but different parameters, it is known as method overloading. Method overloading is one of the ways through which java supports polymorphism. Method overloading can be done by changing number of arguments or by changing

This Article is TAGGED in , , , , , . Read more

Method overloading in Java – Part 2

Method overloading with type promotion:One type is promoted to another implicitly if no matching datatype is found. Let's understand the concept by the figure given below: Example: Method Overloading with Type Promotion[crayon-674190e574c89050268988/][crayon-674190e574c8d121862320/]If there are matching type arguments in the method, type promotion is not performed:Example: Method Overloading with Type Promotion if

This Article is TAGGED in , . Read more