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
Is c# pass by value?
What is lazy in c#?
What is string interpolation in c#?
What is using keyword?
Why are strings immutable c#?
What is the use of protected in c#?
What is difference between float and decimal?
Int map to which .net types?
How can it prevents DLL Hell assembly versioning in .NET?
What's the difference between WindowsDefaultLocation and WindowsDefaultBounds?
What is as keyword in c#?
Can a struct be null?
How many bytes is an int in c#?
Is static thread safe?
What is the default value of date?