C # Learning-Hellow World,
Let's take a look at the Hello World code.
// Single-row comment/* multi-row comment * // using System in XML; // contains a namespace, similar to useusing System in PHP. collections. generic; using System. linq; using System. text; using System. threading. tasks; namespace ConsoleApplication1 // declare namespace {class Progra // declare a Program class {// Main method, all C # Program entries, a c # program has only one Main method. The "Main" method must be placed in any class. For the called "Main" method, its class does not need to be instantiated.
/** Static return value type * void return value * Main method name * args method parameter, which is a string array */static void Main (string [] args) {// System namespace Console class call class method WriteLine () method, output hello world Console. writeLine ("hello world"); // The Console program stops when it is finished. The process is very fast and the result is not visible. Therefore, add this code and wait for the Console button before the end. readKey ();/* Note: * C # Is case sensitive * all statements and expressions must end with a semicolon * program execution starts from the main method * different from java, the file name can be different from the class name */}}}