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

What is predicate c#?

540


How do you inherit a class into other class in c#?

480


What are the types of constructors?

498


Explain the Usage of web.config

576


What is the class in c#?

483






What is binding in c#?

485


Is lazy thread safe c#?

499


What is different between Implicit conversion and Explicit conversion in C#?

513


What is an array of arrays called?

428


How long will it take to learn c sharp?

488


What is winforms c#?

475


is it possible to access a remote web service Without UDDI?

532


What is autopostback in c#?

470


What is the .net datatype that allows the retrieval of data by a unique key?

454


What is the boxing and unboxing in c#?

498