We have two types of classes..
1) Factory 2) Singleton
1) Factory : You can create a multiple object of factory class.
2) Singleton : only one instance of the class is created ex..Mouse Pointer,window popup.
//singleton programme
using system;
public class singleton
{
private static singleton instance;
private singleton()
{
}
public static singleton instance
{
get
{
if(instance==null)
{
instance=new singleton();
}
return instance;
}
}
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment