java-identifier, keyword, comment, escape character

Source: Internet
Author: User

The Java language uses the international character set (Unicode). The Unicode character set defines a set of international standard character sets. The usual ASCII code is 8 bits, while each character in the Unicode character set occupies 16 bits, or 2 bytes, and the entire character set consists of 65,336 characters, compatible with ASCII, and the 256 characters that precede the Unicode character set are ASCII codes. In addition to representing 256 ASCII codes, Unicode can also represent Chinese characters, Latin, Greek letters, Korean, and so on.

Identifiers and keywords in Java are collectively referred to as reserved words.

1: identifierthe names given to constants, variables, methods, classes, or interfaces can be defined by the user, but conform to the following rules:
1.1. Identifiers may consist of one or more characters;
1.2. Identifiers must begin with a letter, an underscore (_), or $, followed by a sequence of characters that can contain numbers, letters, underscores, or dollar signs without spaces;
1.3, the identifiers of uppercase and lowercase letters are different, sensitive to the case, but the length is not limited, the identifier can take any length of the name;
1.4. Keywords cannot be used as identifiers. 2: Keywordshas a special meaning and purpose, can not be arbitrarily used or changed, when we write the program should be careful not to use it as a variable or method name, so as not to cause program compilation errors. keywords in Java : N abstract    boolean break byte case      >catch Char class   continue  default  do    double  else     extends  Finalfinallyfloat forF implements import instanceof int interface Long native new NULL package private protected public return Short static Super switch synchronized this throw throws transient try void volatile while /c6>

NTrue and false are not keywords, similarly, the object value null is not included in the keyword. But they cannot be sent for other purposes.

There are also some keywords, such as cast, future,Goto,Generic,inner,operator,outer,rest,var, etc. are java reserved for meaningless keywords.

Escape characters: Used to denote special symbols or special meanings
\b: Represents a backward character
\ t: Indicates an underscore
\ n: To change to the next line
\ ": represents double quotation marks
\ ": denotes single quotation marks
\ \: Indicates \
Third, the method of annotation
1, multi-line annotation method:
2, the method of the following comment in a row
Comment Statement
calling Method: Enumlist list=enumlist. member N;

java-identifier, keyword, comment, escape character

Related Article

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: 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.