Study Notes (05): C # fast entry - naming variables

Learning immediately: https://edu.csdn.net/course/play/20589/257717?utm_source=blogtoedu

Variable naming rules:

  1. Must begin with the symbol "letters", "_" or "@" to the beginning of the other symbols will be given
  2. It may be followed by any letters, numbers, underscores

     Note: 1) Do not repeat the variable name with C # keyword system

            2) in C #, case sensitive, int age; and int Age; are two different variables.

            3) When you define a variable, the variable name to be meaningful, so easy for people to understand the code, improve code readability.

 

Naming conventions:

    Hump ​​nomenclature: In addition to the first letter of the first word, the first letter of every other word variable names have to be capitalized. Available on local variables and method parameters.

    For example: int myInt;

    Pascal name: the first letter of each word is capitalized variable. It can be used in the class name and the member properties

    For example: string HomeTown;

Released five original articles · won praise 0 · views 20000 +

Guess you like

Origin blog.csdn.net/zimoidieying/article/details/105163976