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 - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -