- 1

Real life examples

real life examples of method overloading and overridding

3rd Mar 2017, 5:39 AM
Amit Singh Rawat
Amit Singh Rawat - avatar
3 Réponses
0
Example, override Lets say a person A has a singing talent.There is a strong chance that his child B will also have it. Here singing is a method. A is a class, B is a subclass.Both of them have same talent but their voices are different. This is same as method overriding, same method name, different properties. Overloading You were eating with a chopstick one day and the other day you ate with fork and spoon. Here, eating is a method.And it is overloaded as you can either eat with fork and spoon or chopstick (called as method parameters)
3rd Mar 2017, 6:07 AM
Meharban Singh
Meharban Singh - avatar
0
these examples are good
3rd Mar 2017, 6:25 AM
Amit Singh Rawat
Amit Singh Rawat - avatar
0
but Little more examples for overriding
3rd Mar 2017, 6:26 AM
Amit Singh Rawat
Amit Singh Rawat - avatar