Skip to content
Sharp

Object-oriented programming · interview question

In which scenario is it beneficial to use multiple constructors in a class?

Multiple choiceMediumchapter-2-curatedpremiumoopconstructors
Choose one answer
Answer and explanation

Correct answer

C. When objects can be initialized in different ways

Why

Multiple constructors, or constructor overloading, allow for objects to be initialized in different ways, providing flexibility in how an object is created.

Test yourself on Object-oriented programming

A free test with instant, explained results. No account needed.

Start free test
All Object-oriented programming questions →