Naming conventions and import use of the package in basic Java

Source: Internet
Author: User

The name of the package is generally used in the company domain name but note that the domain name suffix should be preceded as follows

 Package Com.cnblogs.i.cat// corresponding address is com/cnblos/i/cat.class, which is Cat.class address.

If you want to put a class into a package, in this class source file the first sentence

You must ensure that the class file is in the correct directory

Another class to access: Write full name introduces access to classes in the same package does not need to be introduced

Import com.cnblogs.i.cat// Introduction mode new com.cnblogs.i.cat (); // Full Name Method New Cat (); // under the same package

It is also important to note that the directory of the top-level package of the class file is located under Classpath

Naming conventions and import use of the package in basic 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.