All these keywords are part of the main method of any C# program.
The Main method is the entry point for all C# programs and describes what the class does when executed.
>
using System; class Demo { static void Main(string[] args) { Console.WriteLine("My first program in C#!"); } }
public - This is the access specifier that declares that the method is publicly accessible.
void - This indicates that the method does not return any value.
main - is As mentioned above, it is the entry point of the C# program, that is, this method is the first method to be executed.
The above is the detailed content of What is the difference between public, static and void keywords in C#?. For more information, please follow other related articles on the PHP Chinese website!