Yes. You can mark the main() method as public, private, or protected. If you want to initiate an entry point with some external program, you may need to make it publicly available so that it is accessible. You can mark it as private, if you know that the application is not used externally, then it is better to make it closed so that external applications do not access it.
public class MainMethod { private static void Main(string[] args) { Console.WriteLine("Hello World !!"); } }
Vinayak Savle Dec 13 '18 at 7:40 2018-12-13 07:40
source share