🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: C++ Interview Questions: all 10 questions

Quiz: C++ Interview Questions · Question 6 of 10

What is the difference between overloading and overriding?

What is the difference between overloading and overriding?

  1. A.They are two names for the same thing
  2. B.Overloading: same name, different parameters, chosen at compile time; overriding: a derived class redefines a virtual function, chosen at run time
  3. C.Overloading only applies to operators
  4. D.Overriding happens in the same class
Answer & explanation

Correct answer: Overloading: same name, different parameters, chosen at compile time; overriding: a derived class redefines a virtual function, chosen at run time

Overloading is compile-time polymorphism; overriding a virtual function is run-time polymorphism.

Can you get the rest right without peeking?

Take the timed Quiz: C++ Interview Questions quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →