The difference and effect of Folder,source folder,package under Eclipse

Source: Internet
Author: User

First of all, Folder,source Folder,package is a folder, since it is a folder, then any file can go to these three kinds of folders below the place.
1. The difference between them
folder is a normal directory, and it doesn't have any difference from the folder we use under Window
The source folder is a special folder, if you use object-oriented thinking to see the source folder, then he is a subset of folder, as a subset, it must have all the functions of the folder, but also has its own special features, his special place, Is the Java file under the source folder will be compiled, the compiled file will be placed under a folder we set (generally we set to web-inf/classes), source Folder below the non-Java files will be copied a copy in our settings under the folders, for the way to set:

The package folder is also a special folder, and what is special about him is that he must exist under the source folder and pass through the hierarchy . To differentiate, his path finally consists of the package path name of each class, such as:


2. Their role
Folders is the most common folder, and any files you want to put under eclipse can be placed under folder

Source folder is designed to be used to put the Java files to be compiled, because the Java file to be compiled first, then there is a problem, then the folder can be compiled? Can't be compiled under that folder? So design a special folder called the source, the Java file below him can be compiled, and, you can use a certain configuration to put the compiled files under the folder you configured

Package, designed to give Java files to subcontract, plainly, is to manage Java files, if the source folder as a building, then we are through the package of the building into different floors, different rooms, Different floors different rooms we used to do different things, the room put a lot of Java class, one thing to note is that the final package made up a path name, this path name is not a physical path, but Java, there are many times, is the package with the path name, such as: Web.xml,spring.xml and many other configurations

Conversion of 3.package,source Folder,folder to each other
Package turns into folder display: Select Package, Build path-> Exclude
Folder turns into package display: Select folder, Build path-> Include

Package turns to source folder display: Select Package, build path-> use as source folder
source folder turns into package display: Select folder, Build path-> Remove from BuildPath

Conversion of Pacage to source folder ibid.

The difference and effect of Folder,source folder,package under Eclipse

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.