Java OCA OCP Practice Question 1294

Question

Fill in the blank:

Overloaded and overridden methods always have .

  • A. the same parameter list
  • B. different return types
  • C. the same method name
  • D. covariant return types


C.

Note

Overloaded methods share the same name but a different list of parameters and an optionally different return type, while overridden methods share the exact same name, list of parameters, and return type.

For both of these, the one commonality is that they share the same method name, making Option C the correct answer.




PreviousNext

Related