C # variables and Constants

Source: Internet
Author: User

VariableI,Name variable:IdentifierTo name a variable, follow the naming rules of C #: 1. The variable name can only contain letters, numbers, and underscores, it cannot contain spaces, punctuation marks, operators, and other symbols. 2. The variable name cannot be the same as the keyword name in C #. 2,SyntaxData type variable name;Data type variable name = initial value;General suggestions for variable naming:1. It is best to start the variable name with a lower-case letter. 2. The variable name should be descriptive. 3. In the variable name that contains multiple words, start with the second word, each word is capitalized.Usage principle of variables: declare first and then use!1. Naming constant definition: a constant is a constant volume declaration method:Const Data TypeConstant expression;

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.