+1 vote
in Software Architecture by (75.2k points)
Which of the following is true about factory method?

(a) A factory method is a non-constructor operation that creates and returns class instances

(b) Factory methods are widely used in mid-level design patterns and in object-oriented programming in general

(c) Factory methods create new instances using constructors or cloning, so they do not rely on any special technique for class instantiation

(d) All of the mentioned

I had been asked this question during an internship interview.

Enquiry is from The Generator Category, Factory Patterns and Singleton Patterns topic in chapter Visibility, Accessibility and Information Hiding of Software Architecture

1 Answer

0 votes
by (46.2k points)
Correct answer is (d) All of the mentioned

To explain: All the mentioned are true with respect to factory methods.

Related questions

We welcome you to Carrieradda QnA with open heart. Our small community of enthusiastic learners are very helpful and supportive. Here on this platform you can ask questions and receive answers from other members of the community. We also monitor posted questions and answers periodically to maintain the quality and integrity of the platform. Hope you will join our beautiful community
...