Answer Posted / shadab alam
static costructor of a class invoked automatically when
class is loded provided Main method is given.There is no
need to create instance of a class.
we can prove it by following program in c#
using System;
class aa
{
static aa()
{
Console.Write("without instance");
}
public static void Main()
{
}
}
output will be
---------------
without instance
| Is This Answer Correct ? | 13 Yes | 0 No |
Post New Answer View All Answers
What is an arraylist in c#?
Why c# is type safe?
Are c# destructors the same as c++ destructors?
Differentiate between object pooling and connection pooling in c#?
What is the difference between system.text.stringbuilder and system.string?
What is a namespace server?
Is it possible to restrict the scope of a field/method of a class to the classes in the same namespace?
Can struct inherit from class c#?
What type is string in c#?
Why do we need constructors?
How Global.asax is used ?
Explain the three test cases in unit testing?
You have got 1 million parking slots. At a time a parking slot can be free or not. To get next slot easily which data structure to implement?
What are Indexers in C#?
Which is faster dictionary or list?