Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

When static constructor is invoked?

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


Please Help Members By Posting Answers For Below Questions

What is an arraylist in c#?

1138


Why c# is type safe?

986


Are c# destructors the same as c++ destructors?

1221


Differentiate between object pooling and connection pooling in c#?

1043


What is the difference between system.text.stringbuilder and system.string?

1078


What is a namespace server?

965


Is it possible to restrict the scope of a field/method of a class to the classes in the same namespace?

1048


Can struct inherit from class c#?

1033


What type is string in c#?

909


Why do we need constructors?

953


How Global.asax is used ?

1100


Explain the three test cases in unit testing?

1058


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?

1125


What are Indexers in C#?

1104


Which is faster dictionary or list?

976