Java-Object Oriented Programming

Basic concept of object oriented programming

Tharuksi Gunasekara
2 min readApr 7, 2022

Hello friends, In this article I am going to discuss with you about method overriding and method overloading.
Therefore method overloading and method overriding are a very important concept in java. because they are confusing concepts for novice
programmers. So I am going to illustrate their definitions, differences, and examples for them.

  1. Method Overloading

There are two or more methods in one class have the same method with different parameters.

Ex:

2.Method Overriding

There are two methods with the same method name and parameters.but one method is a parent class and the other method is child class.
therefore Overriding allows a subclass(child class) to provide a specific implementation of a method that is already provided its parent class.

Ex:

3. Differences between method overriding and method overloading

There are many differences between method overloading and method overloading in java.

As the above, these are the main differences that we have to see in the method overloading and method overriding.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Tharuksi Gunasekara
Tharuksi Gunasekara

Written by Tharuksi Gunasekara

I am an undergraduate of faculty of Information technology in university of Moratuwa

No responses yet

Write a response