singleton : Java Glossary


singleton
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:

http://mindprod.com/jgloss/singleton.html

Optional Replicator mirror
of mindprod.com
on local hard disk J:

J:\mindprod\jgloss\singleton.html
logo
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.
Blog
IP:[65.110.21.43]
Your face IP:[23.23.22.200]
You are visitor number