Question OOP-CTOR-0077
HardWhat is a factory method's advantage over a constructor?
- A.
It must be private
- B.
It can't be overridden
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Constructors and Destructors question
What is a factory method's advantage over a constructor?
It must be private
It can't be overridden
Sign up free to see the answer and a step-by-step explanation.
It has a descriptive name, can return a cached or subclass instance, and need not create a new object
It is always faster