Question: What does the code shown below demonstrate, and why?

  1. polymorphism, because each method can perform different task
  2. method overriding, because it display the same method name, different or same parameters, and same return type
  3. method overloading, because it allows the creation of several methods with the same name, wich differ by the type of input via parameter
  4. 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