C # Learning-Hellow World,

Source: Internet
Author: User

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 */}}}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.