A static class is basically the same as a non-static class, but there is one difference: a static class cannot be instantiated. You access the members of a static class by using the class name itself. For example, if you have a static class that is named UtilityClass that has a public method named MethodA,: UtilityClass.MethodA();Use of static class: A static class can be used as a convenient container for sets of methods that just operate on input parameters and do not have to get or set any internal instance fields. For example, the static System.Math class contains methods that perform mathematical operations, without any requirement to store or retrieve data that is unique to a particular instance of the Math class. double dub = -3.14; Console.WriteLine(Math.Abs(dub)); Console.WriteLine(Math.Floor(dub)); Console.WriteLine(Math.Round(Math.Abs(dub)));// Output: // 3.14 // -4 // 3 A static constructor is only called one time, and a static class remains in memory for the lifetime of the application domain in which your program resides. Main features of a static class: • Contains only static members. • Cannot be instantiated. • Is sealed. • Cannot contain Instance Constructors.
Static Class you have only static members.You cannot have instance members(method,properties).
Static can execute without main
1. A static class is a class which cannot be instantiated. 2. A static class can have only static members. 3. Static members of a class can by accessed by dot(.) operator. for example Employee.GetEmployee() 4. Static class is implicitly sealed. Therefore a class cannot inherit a static class.
Static class is a class which cannot be instantiated.The common properties can be declared in Static class.Ex : In a school, 10 students have the same common features.So we can keep the common properties in the Static class.
A static class is basically the same as a non-static class, but there is one difference: a static class cannot be instantiated. In other words, you cannot use the new keyword to create a variable of the class type
Static class it a type of class whose instance can not be created. we can declare static member function , field in static class we can not create non static member function and field in a static class
1.all the members of the class are static. 2.not possible to crate the object of the static class. 3.methods r call by name of class.method name. 4.this is a sealed one
the class which doesn't need any instantiation to access its data members and methods. They can called directly by the class name.
http://www.dotnetperls.com/static-class
Static class is a class which is call without any instance of objects.
Static class is a class which is faster than instance class . Since Static class doesn't require object creation hence it is faster compared to instance class . Inheritance is not allowed on the static classes hence a static class can't act as a base class as well as derived class . regards Lok http://skillgun.com/csharp/interview-questions-and-answers
Features of Static class 1. Inheritance not allow. 2. Creating instance not allow. 3. Must contain only static properties , fields , constructor and methods.
A static class is basically the same as a non-static class, but there is one difference: a static class cannot be instantiated. In other words, you cannot use the new keyword to create a variable of the class type. Because there is no instance variable, you access the members of a static class by using the class name itself.. for example visit this link.. http://www.c-sharpcorner.com/uploadfile/hirendra_singh/static-classes-in-C-Sharp/