Simple method overriding programs | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson

Simple method overriding programs

13th Jul 2017, 5:26 AM
Smart Parath
Smart Parath - avatar
3 Answers
+ 1
here is an example that you may want to check to see difference or understand the meanings of overriding and overloading
11th Sep 2017, 3:10 PM
Melih Melik Sonmez
Melih Melik Sonmez - avatar
I'll give an example. In Java, programmer is forbidden from operator overriding. The language itself does not limit itself this way. Look at the +. It can operate on numbers as well as strings.
13th Jul 2017, 6:16 AM
Venkatesh Pitta
Venkatesh Pitta - avatar
Venkatesh: your example is operator overloading. overriding is when you have the same function name and inputs, but you write another function with the same parameters, but a different action
13th Jul 2017, 6:29 AM
Andrew Lampert
Andrew Lampert - avatar