Java foundation - comments, keywords, identifiers

- Chunhuaqiuyue when, past Know ~

1 comment

  • We usually write code in less time than the code, we can also read their own writing, but when once the project structure complicated, we need to use the Notes

  • Notes and will not be executed, it is to write the code to see us

  • Write notes is a very good habit

  • Java annotations in three ways:

    • Single-line comments

      // 注释内容
    • Multi-line comments

      /* 注释内容 */
    • Documentation Comments

      /** 注释内容 */
      /***
       *               ii.                                         ;9ABH,          
       *              SA391,                                    .r9GG35&G          
       *              &#ii13Gh;                               i3X31i;:,rB1         
       *              iMs,:,i5895,                         .5G91:,:;:s1:8A         
       *               33::::,,;5G5,                     ,58Si,,:::,sHX;iH1        
       *                Sr.,:;rs13BBX35hh11511h5Shhh5S3GAXS:.,,::,,1AG3i,GG        
       *                .G51S511sr;;iiiishS8G89Shsrrsh59S;.,,,,,..5A85Si,h8        
       *               :SB9s:,............................,,,.,,,SASh53h,1G.       
       *            .r18S;..,,,,,,,,,,,,,,,,,,,,,,,,,,,,,....,,.1H315199,rX,       
       *          ;S89s,..,,,,,,,,,,,,,,,,,,,,,,,....,,.......,,,;r1ShS8,;Xi       
       *        i55s:.........,,,,,,,,,,,,,,,,.,,,......,.....,,....r9&5.:X1       
       *       59;.....,.     .,,,,,,,,,,,...        .............,..:1;.:&s       
       *      s8,..;53S5S3s.   .,,,,,,,.,..      i15S5h1:.........,,,..,,:99       
       *      93.:39s:rSGB@A;  ..,,,,.....    .SG3hhh9G&BGi..,,,,,,,,,,,,.,83      
       *      G5.G8  9#@@@@@X. .,,,,,,.....  iA9,.S&B###@@Mr...,,,,,,,,..,.;Xh     
       *      Gs.X8 S@@@@@@@B:..,,,,,,,,,,. rA1 ,A@@@@@@@@@H:........,,,,,,.iX:    
       *     ;9. ,8A#@@@@@@#5,.,,,,,,,,,... 9A. 8@@@@@@@@@@M;    ....,,,,,,,,S8    
       *     X3    iS8XAHH8s.,,,,,,,,,,...,..58hH@@@@@@@@@Hs       ...,,,,,,,:Gs   
       *    r8,        ,,,...,,,,,,,,,,.....  ,h8XABMMHX3r.          .,,,,,,,.rX:  
       *   :9, .    .:,..,:;;;::,.,,,,,..          .,,.               ..,,,,,,.59  
       *  .Si      ,:.i8HBMMMMMB&5,....                    .            .,,,,,.sMr
       *  SS       :: h@@@@@@@@@@#; .                     ...  .         ..,,,,iM5
       *  91  .    ;:.,1&@@@@@@MXs.                            .          .,,:,:&S
       *  hS ....  .:;,,,i3MMS1;..,..... .  .     ...                     ..,:,.99
       *  ,8; ..... .,:,..,8Ms:;,,,...                                     .,::.83
       *   s&: ....  .sS553B@@HX3s;,.    .,;13h.                            .:::&1
       *    SXr  .  ...;s3G99XA&X88Shss11155hi.                             ,;:h&,
       *     iH8:  . ..   ,;iiii;,::,,,,,.                                 .;irHA  
       *      ,8X5;   .     .......                                       ,;iihS8Gi
       *         1831,                                                 .,;irrrrrs&@
       *           ;5A8r.                                            .:;iiiiirrss1H
       *             :X@H3s.......                                .,:;iii;iiiiirsrh
       *              r#h:;,...,,.. .,,:;;;;;:::,...              .:;;;;;;iiiirrss1
       *             ,M8 ..,....,.....,,::::::,,...         .     .,;;;iiiiiirss11h
       *             8B;.,,,,,,,.,.....          .           ..   .:;;;;iirrsss111h
       *            i@5,:::,,,,,,,,.... .                   . .:::;;;;;irrrss111111
       *            9Bi,:,,,,......                        ..r91;;;;;iirrsss1ss1111
       */

2, Keyword

3, the identifier

  • Identifier : refers to the program, we own custom content. Variables such as the name and the name of the class, method name, are represented by symbols
    • HelloWorld case, there appears identifier class nameHelloWorld
  • Naming rules :
    • The identifier may comprise 英文字母26个(区分大小写), 0-9数字, $(美元符号),_(下划线)
    • Identifiers can not begin with a number
    • Identifiers can not be keywords
  • Naming convention :
    • Specification class name: the first letter capitalized, followed by the first letter of each word big (big camel) write
    • Variable name specification: the first letter lowercase, behind each word capitalized (small camel)
    • Method name specification: the same variable name

Guess you like

Origin www.cnblogs.com/huangdajie/p/12409463.html
Recommended