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
Post a Comment