About the main method in c#

The main method is the starting point for any c# program. A C# program can have many classes but only one class can have the main method to initiate the execution. See the following example:
 

class Example
    {
        public static void main()
        {
            Console.WriteLine("Welcome to Authorcode");
                // do something
        }
    }

 
From the above, we are using Public access modifier with main method of the program that refers main method is accessible by anyone. And second keyword static we are using that allows main() to be called before an object of its class has been created and it is necessary to use static with main() because main is called at program startup. You can declare main method as :
 

 public static void main()
        {
          // do something
        }

 
Main method does not return any value so we use the void keyword with it.
Remember that main() can not be use twice in one program.