FileDocCategorySizeDatePackage
Singleton.javaAPI DocExample754Sun Feb 08 21:33:58 GMT 2004None

Singleton

public class Singleton extends Object
An example of a Singleton implementation in Java. The Singleton design pattern is described in GOF; the idea is to ensure that only one instance of the class will exist in a given application.
author
Ian F. Darwin, http://www.darwinsys.com/
version
$Id: Singleton.java,v 1.7 2004/02/09 03:33:58 ian Exp $

Fields Summary
private static Singleton
singleton
Constructors Summary
private Singleton()
A private Constructor prevents any other class from instantiating.


	          
	  
	
Methods Summary
public java.lang.StringdemoMethod()
A simple demo method

		return "demo";
	
public static SingletongetInstance()
Static 'instance' method

		return singleton;