Java Basic Learning--eclipse Importing a Java file

Source: Internet
Author: User

When writing a Java project, you might use another mature Java class file, so how can you import the target class file into the project?

The following Operation.java are examples.

Now a Java file source code.

1. Open Eclipse, "File", "New", "Java project", enter the project name in project name, for example: Com.linwu. The other parameters use the default data. Click Finish

2. Under Project Com.linwu SRC, right click, select New->package, enter the package name in the Name field Com.linwu.

If the package name in the Operation.java file is: Packages Com.linwu; Enter Com.linwu, click Finish

3. Under the package, right click, select Import, select "File System" in "Gerneral", click Next

4. Select the directory where the files are located and select the Operation.java file. Click Finish to import the file.

Java Basic Learning--eclipse Importing a Java file

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.