Subhash Sharma

Subhash Sharma
Subhash Sharma

This is Subhash Sharma(Software Engineer) Blog

Welcome to this blog and find every solution.............

Search This Blog

Software Engineer(Subhash Sharma)

Software Engineer(Subhash Sharma)
Software Engineer

Thursday, March 18, 2010

Types of Classes

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;
}
}
}

No comments:

Post a Comment