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

Enter 3 numbers from the user & make a function to print their average.


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

Write a function which takes in 2 numbers and returns the greater of those two.


View

Take an array of names as input from the user and print them on the screen.


View

What is Apache Zookeeper?


View
List and explain the characteristics of Graphical user interface.
View