What's the Difference between Overloading and Overriding ?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What's the Difference between Overloading and Overriding ??

22nd Aug 2017, 4:43 PM
Syed Tabarak
Syed Tabarak - avatar
4 Answers
+ 5
@Ahmed Careful, Overloading doesn't have to deal with the same class, it can be different classes. For example, if a super class has a method with the same name as the sub class. (With different signature). More info: https://stackoverflow.com/questions/24884151/can-a-method-in-sub-class-overloading-a-method-in-super-class
22nd Aug 2017, 10:33 PM
Rrestoring faith
Rrestoring faith - avatar
+ 3
Overloading deals with two or more methods in the same class with the same name but different arguments. Overriding means, two methods with the same arguments, but different class
22nd Aug 2017, 5:46 PM
Ahmed Sady Rifat
Ahmed Sady Rifat - avatar
+ 1
here is an example that you may want to check to see difference or understand the meanings of overriding and overloading https://code.sololearn.com/c0awDMpDLukF/?ref=app
11th Sep 2017, 2:59 PM
Melih Melik Sonmez
Melih Melik Sonmez - avatar