Java Identifiers and keywords

Source: Internet
Author: User
Tags java keywords

The language features of a Java program consist primarily of identifiers, keywords, and annotations.

First, identifiers

An identifier is actually a name used to identify the classes, objects, variables, methods, interfaces, arrays, files, and so on that are frequently used in the program. Identifiers can be freely defined by the user themselves as needed, but the rules must be met:

(1) Identifiers are composed of letters, numbers, underscores _, and dollar sign $.

(2) Identifiers can only be started by letter, underscore _, dollar sign $.

(3) Java identifiers are case-sensitive, and name and name represent different identifiers, respectively.

(4) Identifiers do not have a length limit, as long as the memory capacity can be satisfied, can take any length of the name.

(5) in the name of the identifier is generally used to represent its meaning in English, so that others can read the meaning of the expression.

(6) Keywords and reserved words cannot be identified as identifiers.

Second, the key word

Some strings with specific meanings are predefined in the Java language, called keywords or reserved words. Keywords in the Java language are represented by lowercase letters. There are currently 50 keywords in the Java language, where const and common goto are two keywords that are currently reserved but not yet used, and do not have a specific meaning.

Java Keywords
Abstract Catch Else Goto Long Return This While
Assert Char Extends If Native Strictfp Throw
Byte Class Enum Implements New Short Throws
Boolean Continue Finul Import Package Static Transient
Break Default Finally instanceof Private Super Try
Case Do Float Int Protected Switch void
Const Double For Interface Public Synchronzized Volatile

Java Identifiers and keywords

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