Is it mandatory to Write static void Main(string[] args) in C#? -


because debug simple program took runtime inputs 2 numbers , showed sum of 2 number. did without writing string[] args. necessary write these in every program?

no, it's not mandatory.

the documentation on main() , command-line arguments (c# programming guide) says:

the main method can declared or without string[] parameter contains command-line arguments.

so, valid entry point:

static void main() {     console.writeline("hello world"); } 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -