2.3 lexical elements

xiaoxiao2021-03-06  64

5 types of lexical elements (symbols, token): Keyword, Identifier, character constant, operator (Operator), and punctuation. Blank and annotations are also two important lexical elements, but these two lexical elements are discarded in the initial stage of compilation. 2.3.1 Blank in the blank java includes space characters, tabs, and wrap. From the structure and sense of the program, in addition to the character literal value, any number of adjacent blank characters - or even the clip clutch, the space is in line with the blank character - actually just one blank. 2.3.2 Note Java has three annotations: single-line comments (//), multi-line comments (/ * and * /, also called block comments), third annotation (/ **, and * /). The third annotation method and the second difference are that it can be identified by the Javadoc program, and Javadoc can automatically extract these comments, generate the HTML document of the program. About Javadoc, you can refer to Section 4.13. 2.3.3 Keyword keywords are also called reserved words, with predefined special purposes, cannot be used as other purposes, a total of 47. Among them, Const and Goto have no meaning in Java (why is it used?), NULL, TRUE and FALSE are actually character constant. 2.3.4 The identifier identifier is some name to specify different elements (clauses, methods, variables) in the Java program. The keyword cannot be used as an identifier. The identifier naming rule can include English large, lowercase letters, symbols, underscores and numbers 0-9, and cannot start with numbers. 2.3.5 Character Constant Basic Types (Primitive Types) Character Constants are also called constant 2.3.6 operators and punctual symbol priorities (Precedence)

转载请注明原文地址:https://www.9cbs.com/read-85312.html

New Post(0)