. NET, the identifier, the keyword, and the. The naming conventions in net

Source: Internet
Author: User

1. keywords

C # defines some keywords (public/static/void/class/int/string) that are used to form the basic syntax of C #.

The blue word in VS is the key word.

The Main, String, console, and so on are not keywords. And just. NET class Library provides a number of methods, properties, etc... In theory, if you don't reference these libraries, there's no such stuff.

2. Identifiers

Identifiers are used to name classes, methods, variables, and so on.

Naming rules (legal level, non-compliance On error):

1) consisting of letters, Chinese (not recommended), numerals, underscores;

2) cannot begin with a number;

3) cannot be a keyword.

4) C # language is case-sensitive: Demo and demo are two things;

Industry norms (moral constraints, non-compliance may be scolded, but will not error)

1) Hump naming method: Capitalize the first letter of each word.

2) The method name, class name, property name, and the first letter of each word are capitalized.

3) field name, variable name the first word in lowercase, followed by a word to capitalize.

4) The field name, (especially in the entity class) begins with "_" and the first letter is lowercase. such as _classname

5) interface name, usually beginning with "I", sometimes ending with "able".

. NET, the identifier, the keyword, and the. The naming conventions in net

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.