Java Learning Note Note--5, identifiers

Source: Internet
Author: User

1, the concept of identifiers

Identifiers are used to name classes, objects, methods, variables, interfaces, and custom data types.

2, the composition of identifiers

,   identifiers can be letters, numbers, underscores ( _ $ @ , % Other special characters, such as spaces, cannot begin with a number.

2. identifiers cannot be java keywords and reserved words ( java reserved keywords, in future upgrade versions have may be a keyword), but can contain keywords and reserved words.

3. Identifiers are strictly case-sensitive. So nirvana, be sure to distinguish between Chu Imooc and IMOOC is two different identifiers Oh!

4, the name of the identifier is best to reflect its role, to be known.

5. Variable name = First character + remainder

First Character: letters, underscores, ' $ ' symbols

The rest of the section: numbers, Letters, underline, ' $ '

3. Naming conventions

1. Variable name

You should avoid keywords

2. Variable name

Camel - compliant hump naming method

If the name consists of multiple words, start with a second word and capitalize the first letter

3. Variable name

Simple and straightforward representation of the function of the variable, first letter lowercase


Java Learning Note Note--5, 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.