LearnFrenzy
Sign in Take a free test

OOPS Concepts · OOPS Concepts MCQ · Question 15

Function overloading vs overriding Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
Question 15 Back to Exercise

Which statement is correct?

  • A Overriding happens in one class with different parameters
  • B Overloading: same name, different parameters, chosen at compile time; overriding: a derived class redefines a virtual function with the same signature, chosen at run time Correct
  • C Both are resolved at run time
  • D Overloading needs virtual
Correct Answer: Option B

Overloading is compile-time polymorphism; overriding enables run-time polymorphism.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links