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

Answer Posted / basha

In C# language CLR (common language run time) compiler program Execute from Main() method only In this declare static keyword we can't create instance to that method (or) class.
Example:

class A // step 3: class A is declare
{
public void Main()//step 4: In class A have contain a method Main. In this method contain print some text
{
Console.WriteLine("main method call");// step 5: by call main method to print this text.
}
}

class B
{
public static void Main() //step 1: Execute program form this
{
A obj = new A();// step 2: after compiler check here what is A? here A is class creating object to class A.

obj.Main(); // step 6:print text from Main() method in class A
}

}

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is helper method in c#?

662


What does int32 mean?

662


What are accessors?

699


What is difference between overloading and short circuiting?

677


So let's say I have an application that uses myapp.dll assembly, version 1.0.0.0. There is a security bug in that assembly, and I publish the patch, issuing it under name myapp.dll 1.1.0.0. How do I tell the client applications that are already installed to start using this new myapp.dll?

669


What is keywords in c#?

661


What is private void in c#?

684


What is field in c#?

637


What is single dimensional array in c#?

700


Explain manifest in c#.

716


How do you implement thread synchronization in c#?

645


How do you escape in c#?

717


Can constructor be protected in c#?

681


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

756


What are the namespace level elements?

667