basically singleton class allows only one instance of the class to be created at any time
Thanks, Shiv
SCJP, OCE - JSP & Servlets Developer
David McCombs
Ranch Hand
Joined: Oct 17, 2006
Posts: 212
posted
0
Are you asking what a singleton is or what classes in the API implement that pattern?
If the former, a search on this site should prove useful as it is a often talked about topic.
If the latter, look for a class with a private constructor AND has a static method named something like getInstance() or getNameOfClass. If a constructor is not shown in the API it is private.
A well known singleton is Runtime, but there are many more. Another possibility is MessageDigest. Although that one has a protected constructor, so I am not sure it can be considered a singleton. Anyone know?
"Should array indices start at 0 or 1? My compromise of 0.5 was rejected without, I thought, proper consideration."- Stan Kelly-Bootle