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

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -