You would use a static class if:
1. You just want a class to contain a bunch of static or constant members.
2. You don't want it to be possible to instantiate the class.
3. You don't want it to be possible to inherit from the class.
In effect, static classes are the nearest thing we have to procedural programming in an otherwise object oriented language.
static class Program
const string Hello = "Hello"; // it's OK for a static class to include a constant
static void Main() // all members of a static class must be static, const or nested types
Console.WriteLine("The Main method is in a static class");
Program P = new Program(); // compiler error - can't instantiate a static class
class Yourclass // it's OK for a static class to include a nested type
class MyClass : Program // compiler error - can't derive from static class
}Nksingh420, if this helps please login to Mark As Answer. | Alert Moderator