Naming rules in Java

Source: Internet
Author: User

Some of the named specifications in Java:

1. Package-lowercase letters-for example COM.APPLE.QUICKTIME.V2

2. Class-Uppercase, mixed case-for example, class Image

3. Interface-Similar to class, preferably I start-for example interface ICar

4. Method-generally verbs, mixed case, first letter lowercase-for example runfast ();

5. Variables-similar to basic and method, temporary variables can be used i,j,k, others as far as practicable meaning-for example, float mywdith;

6. Method Parameters-the same as the variable rules, generally plus p_-for example Runfast (String p_name, int p_mywdith);

7. Instance variables-similar to variables, usually underlined-such as int _employee;

8. Constants-all uppercase, between words separated by _-for example, static final int max_width = 5;

Naming rules in Java

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.