Unger Technologies LLC

GREG UNGER MY FACEBOOK ATHLETE PAGE MY YOUTUBE CHANNEL Follow me on Twitter FOLLOW ME ON TWITTER

Why is the Main() method static?

Static members are scoped to the class level (rather than the object level) and can thus be invoked without the need to first create a new class instance. The Main() method is static because it’s available to run when your program starts and as it is the entry point of the program, it runs without creating an instance of the class. In other words, static functions exist before a class is instantiated, so static is applied to the main entry point.

No comments:

Post a Comment