+ 3

What is the difference between method overloading and method overriding?

21st May 2017, 11:18 PM
Joel Buenrostro
Joel Buenrostro - avatar
2 Respostas
+ 9
Method overloading is designing a method in a way for it to behave differently, depending on their arguments' data types. For example: the '+' sign and a hidden method behind it, acts each time differently when adding integers, floats or strings. Method overriding is commonly done when a method inherited by a class from its parent class has to be modified. You simply define it again in a child class. Depending on a language, it might require allowing the parent method to be overridden.
22nd May 2017, 8:12 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 4
here is an example in java but 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, 3:03 PM
Melih Melik Sonmez
Melih Melik Sonmez - avatar