Skip to main content

What is the difference between overloading and overriding ?


If a class have multiple methods by same name but different parameters, it is known as Method Overloading.Method overloading deals with the notion of having two or more methods in the same class with the same name but different arguments.

If we have to perform only one operation, having same name of the methods increases the readability of the program.

Method overriding means having two methods with the same arguments, but different implementations. One of them would exist in the parent class, while another will be in the derived, or child class. The @Override annotation, while not required, can be helpful to enforce proper overriding of a method at compile time.
Kriti Nidhi

Kriti Nidhi

Kriti Nidhi is a tech enthusiast and a geeky programmer. She holds passion about programming and new technologies.
Kriti Nidhi

Leave a Reply

Your email address will not be published. Required fields are marked *