singleton : Java Glossary


Singletons are the design pattern when you want only one instance of a class created. You make the constructor private and give access to the instantiated object via a static instance method that creates the object if it has not been created already. The advantages of this technique over using class variables and methods are: Here is typical code courtesy of Chris Smith for postponing the creation of the singleton in a way that is thread safe.

This page is posted
on the web at:

Optional Replicator mirror
on local hard disk J:

Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.
no blog for this page
Your face IP:[]
You are visitor number