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
How is a string immutable?
Why do we use 0?
What are c# types?
What is the base class in .net from which all the classes are derived from?
Which namespaces are necessary to create a localized application?
What are extension methods and where can we use them?
Who benefits from ajax?
What does void mean in c#?
How to move to a state-related codebase?
What is multicast delegate in c# ?
Explain the difference between event and a delegate in c#?
Is stringbuilder better than string?
Why do we need nullable types in c#?
What is assembly manifest?
What do you mean by winforms in c#?