Java Naming rules (simple), java Naming

Source: Internet
Author: User

Java Naming rules (simple), java Naming

1. Package

All lowercase letters, with the prefix defined by the domain name.

Example: teach. golddrem. javagroup

2. Class

Start with an uppercase letter, followed by an uppercase letter. If there is an abbreviation, all the abbreviations are in uppercase.

For example: InformationManageProject, SCCBManage

3. Method

The START letter is lowercase, followed by the first letter of each word.

Example: projectAdd

4. Constants

Specify the meaning of all uppercase letters. Multiple words are separated by underscores.

Example: AVG_SALARY

5. Variables

Hump rule: lowercase letters at the beginning and the first letter of each word at the end.

Hungary name method: the start Letter and the first letter of each word are uppercase, and then the prefix is added to the front. Refer to Baidu Encyclopedia: Hungary name method.

6. Parameters

Naming by the same method, but the meaning should be as clear as possible.

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.