Create a NetBeans project that will contain all of your homework projects for the rest of the course.
Source Packages
folder and select New
-> Java Package
. Enter your webmail user name for the name of the
project.New -> Java Main
Class...
Menu
.From now on, you will use this project for all your homework assignments. You will just add more packages and main classes to this project.
Add a package to the application. This package will contain several main classes: one for each part of the assignment.
New -> Java
Package
. Set the name as username.chX
(replace
username with your webmail user name and X with the chapter
number; for example, tdowne99.ch5
).username.chX
package and select New ->
Java Main Class...
. Give the new class an appropriate name for the
part of the assignment it implements, for example, Batting
.
Add a print statement in the main method that prints a simple message, like,
"Batting Class".
The Menu
class is the main class for the entire application.
It can access the Batting
class that you just added.
Menu
class and import the Batting
class,
for example import tdowne99.ch5.Batting
.
run: Menu calling the Batting class Batting Class BUILD SUCCESSFUL (total time: 0 seconds)
For each chapter, you will add a new package, for example,
tdowne99.ch6
. For some chapters, you will define multiple main
classes to implement each part of the assignment.