Older Dick Silk Self-study note--java 0 basics to rookie--005

Source: Internet
Author: User

keywords, identifiers, comments, constants

1. Key words

The Java language has a specific meaning of the word, the letters are all lowercase, such as: class, public, static, void ...

2. Identifiers

Names of interfaces, classes, methods, variables, such as Fin, main ...

Composition rules: English letters, Numbers, $, _ ...

Note: Cannot start with a number, cannot use keywords, English letters are case-sensitive

Naming rules: Package: Lowercase letters, multi-level package between the subordinate ".", such as: Liverpool (single-stage package), Liverpool.gerrard (multi-level package) ...

Interface: Uppercase "I" with the first letter of each word capitalized, such as: Ifin, Iliverpoolgerrard ...

Class: Capitalize the first letter of each word, such as: Fin, Liverpoolgerrard ...

     Method: First letter lowercase, the remaining words capitalized, such as: Main, Liverpoolgerrard ...

Variables: First letter lowercase, the remaining words capitalized, such as: Liverpool, Liverpoolgerrard ...

Constants: All letters are capitalized, and words are separated by "_", such as: LIVERPOOL, Liverpool_gerrard ...

3. Comments

Single-line Comment://

Multiline Comment:/* ... */

Documentation Notes:/** ... */

4. Constants

The amount of value does not change during program execution.

String constants: "Liverpool"

Character constant: ' n '

Integer constants: 1892

Decimal constants: 3.14

Boolean constant: True, False

NULL constant: null

Older Dick Silk Self-study note--java 0 basics to rookie--005

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.