What is the output from the following code
Can we have multiple Main() methods in our program, like in the following?
using System; namespace MultipleMainTest { class Program1 { static void Main(string[] args) { Console.WriteLine("I am inside Program1.Main(string[] args) now"); Console.ReadKey(); } } class Program2 { static void Main() { Console.WriteLine("I am inside Program2.Main() now"); Console.ReadKey(); } } }
Compile time error
To avoid this error, set the entry point from your project properties in visual studio.