Semester -    Subject -

What is method overloading?


If a class, has multiple methods having same name but different in parameters, it is known as Method Overloading.

Method overloading is a form of polymorphism in OOP. Polymorphism allows objects or methods to act in different ways, according to the means in which they are used. One such manner in which the methods behave according to their argument types and number of arguments is method overloading.

For example: 

Here, the func() method is overloaded. These methods have the same name but accept different arguments.



Share to whatsapp

More Questions from Module 0

How to use database in Golang?
View
Connect Golang to MySQL
View
How to integrate database in Golang?
View

Applications of Apache Ambari Core


View
List out the steps of Candidate Elimination Algorithm. Apply the algorithm to obtain the final version space for the training example.
View

Origin of soil


View