Swati Agarwal
Why main function is static?
Posted by Swati Agarwal in .Net | ASP.NET on Nov 21, 2012
  • 0
  • 6
  • 1101
Do you know the answer for this question? Post it below.
Guest
Posted by vipul handa on Dec 26, 2012
  • 1

The static keyword indicates that it is single copy in to memory As main is entry point to execute the code so is is static and it doest require any object calling

Posted by Mahesh Patel on Nov 27, 2012
  • 1

static is the key word is indicate in .net that, it can not be changed. while main is key word to indicate the main portion of application from where application is started. so the main entry point of application is fixed can not be changed as definition. but we can change its implements. so this is static.

Posted by keerthi rakasi on Feb 28, 2013
  • 0

static is used to preserve memory at compilation time.so,that main function will be stored in memory any will be executed.

Posted by amir ansari on Jan 05, 2013
  • 0

Every C# program of main is Entry Point of the execute the code.we know that static keyword is single copy in to memory.static keyword are without instanse.so it is use of static keyword in main function.

Posted by shrikant mule on Dec 25, 2012
  • 0

as main function is entry point in execution and static keyword need not require any object for calling main function, so program starts directly from 'static main' in class

Posted by Krishna Garad on Nov 27, 2012
  • 0

Main is the entry point for an application and to access the entry point from any where in an application that's why main is static.


Join a Chapter
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.
PRIVACY POLICY | TERMS & CONDITIONS | SITEMAP | CONTACT US | ABOUT US | REPORT ABUSE
2013© C# Corner. All contents are copyright of their authors.