Basic and Advance Programming Question:

Download Job Interview Questions and Answers PDF

What is difference between overloading and overriding in programming language?

Programming Interview Question
Programming Interview Question

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 Interview Questions And Answers PDF

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?