What is the different between overloading and overridden? Does constructor and Destructor same? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

What is the different between overloading and overridden? Does constructor and Destructor same?

24th Jul 2018, 1:21 AM
ANNM
ANNM - avatar
3 Answers
+ 5
Overriding ties in with inheritance. For example the parent class Mod has a method "report(int num)", in the child class GoldMod, you want the report method to do something different, you override it. Note that the method signature remains the same. Now in our GoldMod class, we want report() to work differently if a char is given as an input. Hence, when you want to use a different method signature, you overload. Note the difference.
24th Jul 2018, 1:56 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 2
good vai
4th Aug 2018, 4:42 PM
Albert Whittaker :Shaken To Code
Albert Whittaker :Shaken To Code - avatar
0
thank so much 👍😀 Dark Angel
24th Jul 2018, 7:44 AM
ANNM
ANNM - avatar