Interviews14 answers
What is static class?
14 Answers
Static Class you have only static members.You cannot have instance members(method,properties).
Mageshwaran RPosted Nov 29, 2018, 5:34 AM EST
Static can execute without main
Mukesh KumarPosted Sep 5, 2017, 12:06 AM EDT
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.
Anil JhaPosted Mar 2, 2016, 12:19 AM EST
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.
satish kumarPosted May 23, 2015, 10:48 AM EDT
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
Posted Apr 15, 2015, 4:08 AM EDT
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
Pankaj Kumar ChoudharyPosted Apr 2, 2015, 7:32 PM EDT
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
Sunil GadedPosted Aug 28, 2014, 2:26 AM EDT
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.
Manju lata YadavPosted Jun 29, 2014, 11:10 PM EDT
the class which doesn't need any instantiation to access its data members and methods.
They can called directly by the class name.
AshishPosted Apr 23, 2014, 10:04 PM EDT
http://www.dotnetperls.com/static-class
Munesh SharmaPosted Apr 11, 2014, 11:40 PM EDT
Static class is a class which is call without any instance of objects.
Dileep Kumar PatelPosted Apr 2, 2014, 3:56 AM EDT
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
Palle TechnologiesPosted Apr 1, 2014, 11:39 PM EDT
Features of Static class
1. Inheritance not allow.
2. Creating instance not allow.
3. Must contain only static properties , fields , constructor and methods.
shimab alamPosted Apr 1, 2014, 3:50 AM EDT
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/
Mukesh Kumar TiwariPosted Mar 27, 2014, 2:46 AM EDT










