Question: What does the code shown below demonstrate, and why?
- polymorphism, because each method can perform different task
- method overriding, because it display the same method name, different or same parameters, and same return type
- method overloading, because it allows the creation of several methods with the same name, wich differ by the type of input via parameter
- method overriding, because it display the same method name, different parameters, and same return type
Answer: The correct answer of the above question is Option C:method overloading, because it allows the creation of several methods with the same name, wich differ by the type of input via parameter