• 0

[JAVA] Factory Methods


Question

Hey guys,

I'm struggling a little bit with understanding factory methods.

Am I right in thinking that it is where you implement the singleton method and ensure you only have one instance of the object?

Thanks,

David

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Factories don't have to be singleton, but usually they are... case might be computer factory where constructor arg is country name....but of course you could make singleton, by adding the arg to method call

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.