Java Import Package

Source: Internet
Author: User

Importing packages

Problem: How to resolve a class name conflict.

Workaround: Sun provides an import package statement that lets us resolve the issue.

The role of the import package statement: simplifies writing.

Format of the Import Package statement: Import Package name. class name; (Import XXX Package XX Class)

Details of the Import package statement:

1. Multiple statements can appear in a single Java file.

2.* can be used to match any class name.

3.import aa.*; is a sub-package that does not function under AA.

Recommended use: Import package name. class name;

Cause: * Wildcard characters can cause unclear structure. (How to have the same class name, but you don't know which package to import from)

Java Import Package

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: 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.