What are the examples of Singleton design pattern in JDK?

In JDK there are many places where Singleton design pattern is used. Some of these are as follows:

  • java.lang.Runtime.getRuntime(): This method gives Runtime class that has only one instance in a JVM.
  • java.lang.System.getSecurityManager(): This method returns a SecurityManager for the current platform.java.awt.Desktop.getDesktop()
Read the full book at www.amazon.com
Posted in Design Pattern, Design Pattern Interview Questions

Leave a Reply

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

*