Java Reference
In-Depth Information
In the New Java Application dialog, enter
TestApp
as the project name. Enter or browse
for a location where you want to save the project files. Make sure the checkbox “Create
Main Class” is selected and a class name
com.jdojo.intro.Welcome
is entered next to
the checkbox. Click the Finish button when you are done. The new TestApp project with
a
Welcome
class will be opened in the IDE, as shown in Figure
2-11
. You might see some
more comments for the
Welcome
class, which are added by NetBeans when it creates a new
class; I removed most of the comments before taking the screenshot.
3.
Figure 2-11.
The NetBeans IDE with TestApp Java Project
Replace the
TODO
comments in the
main()
method of the
Welcome
class with the following statement. The IDE
should look similar to the one shown in Figure
2-12
.
System.out.println("Welcome to the Java world.");
Figure 2-12.
The Welcome class after adding a statement in the main() method