Getting Started with C # basics-Introduction to Keywords

Source: Internet
Author: User
This article mainly introduces the basic knowledge of C #-the key word of the relevant knowledge, has a good reference value, followed by a small series to see it

Example:

Using system;using system.collections.generic;using System.text;namespace test{class Program {  static void Main ( String[]args)  {   Console.WriteLine ("Hello world!");}}}  

1. Keyword class, the purpose of this keyword is to declare the class, is the C # program the smallest unit, such as the above example, the class name is called program.

2. Keyword namespace, the purpose of this keyword is to declare "namespaces." In the example above, the namespaces are called MYAPP1.

3. Keyword using, the purpose of this keyword is to import namespaces. For example: using System.Text; The role is to import classes in the System.Text namespace.

4. Keyword static (static), void (no return value), string (string type). Often seen in the declaration of the main () method: static void Main (string[] args)

5. The main () method is a special method in C #, the entrance to the program, which means that the program cannot start without the main () method.

6. All keywords are made up of lowercase letters, and the case is strictly distinguished in the C # language.

7. Shortcut key--f5 (for debugging); CTRL + F5 (no debugging, direct start).

8. Output a word of command: Console.WriteLine ("Hello world!")

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.