Singleton design patters are used where there is only one instance of an object is required.
Here is an example of singleton class.
public class singleton
{
private static singleton instance=null;
static public singleton getInstance()
{
if(instance==null)
instance=new singleton();
return instance;
}
private singleton()
{}
.
.
.
.
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment