Archive

Archive for January, 2007

Why Is Method Main Declared static?

January 20, 2007 Leave a comment

Why must Main be declared static ? During application startup when no objects of the class have been created, the Main method must be called to begin program execution. The Main method is sometimes called the application’s entry point. Declaring Main as static allows the execution environment to invoke Main without creating an instance of the class. Method Main is often declared with the header:

public static void Main( string args[ ] )

Advertisements
Categories: C#. Net