Hello, well it's pretty easy if you do a google search (for singleton pattern): http://csharpindepth.com/articles/general/singleton.aspx About nullable types, you cannot define int, double, char as null in C# To do that you can use nullable type. This is written like: int? myvar=null; This is interpreted like Nullable<int> myvar=new Nullable<int>(); Good luck!
public class Singleton { private static Singleton instance; private Singleton() { } public static Singleton GetInstance() { if(instance==null) { instance=new Singleton(); } return instance; } } Code (markup):
just declare a class as static and you have a class that does similar job as singleton without unnecessary coding.
How to use nullable types in .Net ans: Data Types are divided into two catagories Value Type :int,float,double Reference Type :string ,class by default value types are non nullable to make them nullable you can use ? int i = null (not possible) int ?i= null(possible)