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...

what does static void Main(string[] args) in C# mean????????

Answer Posted / subhash

This can be explained as below

public : since the method will be accessed by the other
classes(.net runtime). That is why access modifier is Public

Static:
.net runtime environment call static method of the class
where main is defined. By making Main method as static .net
runtime environment do not need to make object of the class.
runtime environment call the method something like as stated
below.

Class A
{
A()
{}
public static void Main(string[] agrs)
{
}
}

.net Runtime-->
A.Main(args)

Void :
Main method does not return anything

(string[] args):
Here we can pass any number of parameter to the class.
lets say we are making an exe taking 2 parameters then we
can pass parameters to the main method

Is This Answer Correct ?    89 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Define Virtual folder?

1011


What is virtual class in C#?

990


Is collection a data structure?

943


Is c# int immutable?

911


Explain the term inheritance in C#.

948


When Should You Call The Garbage Collector In .net?

1034


Distinguish between finally and finalize blocks?

910


What is default value of enum c#?

887


What is boolean method?

940


Can you create sealed abstract class in c#?

878


Explain About Virtual functions and their use.

1018


What is the difference between add and addrange in c#?

1004


What is a value type in c#?

964


What is the difference between read and readline in c#?

919


Can a class have more than 1 destructor?

1014