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
How do I download a program to my desktop?
Why do we need constructors?
Can scriptable objects have methods?
Can the nested class access, the containing class. Give an example?
Why delegates are type safe in c#?
What are scriptable objects?
What is a ienumerator?
What happens if the inherited interfaces have conflicting method names?
what is the meaning of Object lifetime in OOPS
Why abstract class is not instantiated in c#?
How many types of namespaces available in version4?
Is vs as c#?
Is goto statement supported in c#?
What is the difference between read and readline in c#?
Is string immutable in c#?