Java Reference
In-Depth Information
6.
If you double‐click on the project name or press the small arrow to the left of the project, you will
see the contents of the project folder. Right now, it contains a folder called src , which stands for
source, and the JRE System Library for the Java release attached to this project, JavaSE‐1.8, in the
book examples. The src folder is still empty since you have not created any source files yet.
7.
Create a package to organize your source files. This step is not necessary, as putting class files
directly into the src folder will place them in a default package. However, using this default pack-
age is discouraged. As you develop larger programs, it will become more important to use packages.
Add a package by right‐clicking on the project or src folder, as shown in Figure 3-11, or choosing
File New Package.
figure 3-11  
8.
A New Java Package window, like the one shown in Figure 3-12, will appear. Indicate which
project this package belongs to and the name of the package. The source folder should say
MyFirstProject/src ; it may automatically enter this or you may need to enter it yourself. You
can also find the correct project location using the Browse button. Name the package myPackage
and press Finish. You should see the package appear under the src folder in your project. The
square package icon will be white, indicating that it is empty.
Search WWH ::




Custom Search