Differences between package, source folder, and folder

Source: Internet
Author: User

In eclipse, packages, source folder, and folder are all folders.

Their differences are as follows:
Package: When you create a package, it is automatically created under source folder and can only be created under this directory.

Source folder: a folder for storing Java source code, including some package folders and other files.
After the project is built, Java in source folder is automatically compiled into a class file to the corresponding bin folder, and other files are moved to the corresponding directory.

Folder: contains any file. including Java source files, Jar files, and other files (such as images and sounds ). here I will explain that if the Java source file is contained, eclipse will not report errors no matter whether the program is correct or not, and treat them as common files. however, if you want to use the files in the project, the situation is different.

 

 

Package :Eclipse automatically compiles the code and package in the same folder;

Source folder: Eclipse will automatically compile the class files, but the folder itself will not compile;

Folder:The following classes are not compiled by ECLIPSE into the specified file package.

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.