Basic and Advance Programming Question:

What is difference between overloading and overriding in programming language?

Tweet Share WhatsApp

Answer:

Difference between overloading and overriding in programming language is:

a) In overloading, there is a relationship between methods available in the same class whereas in overriding, there is relationship between a superclass method and subclass method.

b) Overloading does not block inheritance from the superclass whereas overriding blocks inheritance from the superclass.

c) In overloading, separate methods share the same name whereas in overriding, subclass method replaces the superclass.

d) Overloading must have different method signatures whereas overriding must have same signature.

Download Programming PDF Read All 34 Programming Questions
Previous QuestionNext Question
How many ways can an argument be passed to a subroutine in programming?What is the difference between superclass and subclass in programming?