- 1
Real life examples
real life examples of method overloading and overridding
3 Antworten
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)
0
these examples are good
0
but Little more examples for overriding