What is the difference between Overloading and Overriding in JAVA? - ProProfs Discuss
Advertisement

What is the difference between Overloading and Overriding in JAVA?

What is the difference between Overloading and Overriding in JAVA?

Change Image    Delete

Asked by Denton Perez, Last updated: Nov 25, 2024

+ Answer
Request
Question menu
Vote up Vote down

2 Answers

E.Evelyn

E.Evelyn

E.Evelyn
E.Evelyn

Answered Mar 03, 2020

Overriding and overloading are two different concepts that are being used in Java right now. Overriding means that there are two methods that are available that will be used in order to implement the needed process. When you do overriding, this means that you are doing a run-time concept.

Overloading is different in a sense that when you do it, this means that you are following a compile-time concept. It can be difficult to understand java in the beginning but the more that you try to do things, the more that you will understand why these things are needed. You may sometimes need to guess the output based on the things that you have learned.

upvote downvote
Reply 

O.Olivia

O.Olivia

O.Olivia
O.Olivia

Answered Feb 27, 2020

There are many features that are very important in most programming languages, overriding and overloading are just two examples of those features. In Java, when a method has been defined in a parent class, and there arises a need to redefine the method, overriding is a perfect feature that allows a user to achieve this, most importantly in object-oriented programming.

Overriding will allow a subclass created to implement certain instructions that are already available in a superclass. On the other hand, overloading will allow the development of multiple methods that share the same class and name, but the only difference is that they differ in their functions in terms of what they receive as inputs and the types of outputs they give.

In other words, overloading will allow you to have multiple versions of a particular method but with different signatures. Since the signatures are not the same, there will be several outputs.
upvote downvote
Reply 

Advertisement
Advertisement
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader

Email Sent
We have sent an email to your address "" with instructions to reset your password.