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
When a Static Constructor is called in a Class?
Are c# objects passed by reference?
What is the use of 0 in c#?
Why do we need delegates in c#?
Why do we use 0?
Can we have 2 main methods in c#?
Why dictionary is faster than list?
Can you explicitly call a destructor?
Explain About Iunknown interface Queue
Can I define my own exceptions?
What is difference between array and list?
What is public void in c#?
What are the Types of values mode can hold session state in web.config
3. Use layered architecture for coding. s.no name description 1 abc xxxxxxxxx 2 abc xxxxxxxxx 3 4 5 6 7 8 Select all Clear all Add Delete Name Description Save close
What Is An Interface Class?