Java language simple syntax

Source: Internet
Author: User

Identifiers can be used to identify variable names, class names, method names and file names in a class, and so on.

Naming rules:

(1) consists of letters, numbers, underscores, and $, and cannot begin with a number.

(2) Case sensitive.

(3) Do not use keywords and reserved words in Java.

Keywords: are lowercase, jdk1.2 more strictfp (precision floating-point type), the keyword jdk1.4 more assert (assertion) keyword, jdk1.5 more enum (enum) keyword.

True, FALSE, and Null strictly speaking should not be counted as keywords, it should be called the reserved word more appropriate.

Habit:

(1) Identifiers conform to semantic information.

(2) contains all letters lowercase.

(3) The class name is capitalized in the first letter of each word, and other lowercase, such as tarenastudent.

(4) Variables and methods: The first word lowercase, starting with the second word capitalized, such as: Tarenastudent.

(5) Constant: All letters are capitalized, and each word is connected by _.

Commonly used escape characters:

"\" (BACKSPACE)

"\f" (page change)

"\ n" (line break)

Java language simple syntax

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.