What is the difference between a Singleton and a Prototype pattern?

  • None of the above
  • The Singleton and Prototype patterns are the same
  • The Singleton pattern creates multiple instances, while the Prototype pattern creates only one instance
  • The Singleton pattern creates only one instance, while the Prototype pattern creates multiple instances
The Singleton pattern ensures that a class has only one instance and provides a global point of access to that instance, while the Prototype pattern provides a mechanism for creating object instances that are exact copies of a prototype object
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *