Java Naming conventions

Source: Internet
Author: User
Tags naming convention
HTTP://LPACEC.ITEYE.COM/BLOG/25180 Package Name: The package name is all lowercase nouns, the middle can be separated by points, for example: java.awt.event;

Class Name: Capitalized, usually composed of multiple words of a class name, requiring that the first letter of each word should also be capitalized, such as Class Helloworldapp;

Interface Name: The naming convention is the same as the class name, for example interface Collection;

Method Name: Often composed of multiple words, the first word is usually a verb, the first letter lowercase, the middle of each word of the first letter should be capitalized, for example: Balanceaccount,
isbuttonpressed;

Variable name: All lowercase, usually nouns, for example: length;

Constant name: The constant name of the base data type is all uppercase, and if it is composed of more than one word, it can be separated by an underscore, for example: int year, int
Week_of_month; If it is a constant of an object type, it is a mixed case, separated by uppercase letters.

Java Naming conventions

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.