Java annotations, keywords, and identifiers

Source: Internet
Author: User

Comments:

Single-line comment//comment content

Multiline comment/* Comment content */

Document Comments/** Comments */

"Comments are used to make it easier for writers and others to read the source code and to enhance their understanding of the code.

Where a document comment is basically the same as a multiline comment, the only difference is that the document comment can use the Javadoc.exe command to generate the API document "

Key words

Keywords are special meanings given by the Java language, words with specialized purpose, and keywords in Java are lowercase.

1    Abstract    assert    Boolean        Break       byte2      Case        Catch     Char        class       Const3     Continue      default       Do       Double       Else4     enum        extends    Final       finally      float5      for        Goto       if      Implements      Import6     instanceof    int       Interface      Long        native7     New       Package   Private     protected        Public8     return     STRICTFP     Short        Staticuper9     Switch    synchronized    This         Throw        throwsTen     transient    Try       void       volatile

Identifier

Identifiers are the meanings of names, and all names are collectively referred to as identifiers. In Java, you often define classes, methods, and variables, and always give them names when defining them, which are identifiers.

1. Constituent elements

English characters: a-z,a-z "all Letters"

Number: 0-9 "all Numbers"

Symbols: _ With $

2. Rules for identifiers

Cannot start with a number

You cannot use keywords

Strictly case-sensitive, do not limit the length of the naming, as far as possible to achieve the name of understanding

  

  

Java annotations, keywords, and identifiers

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.