Java Reference
In-Depth Information
Figure 1-16.
RAD will display a “run configuration” for EmployeeApp in the “Run Configurations” window. In the future,
you can simply select this run configuration to execute EmployeeApp.
4.
On the “Run Configurations” window, click the Run button.
The first time a Java application is executed it may take a while because RAD must perform one-time
configuration and setup tasks. Remember, the Console view is the default area for printed text to be displayed and,
in this case, the text “Howdy” appears. This proves that the main method is executed when a Java class is run as an
application .
The last application executed is considered the default application. To rerun EmployeeApp, simply click the Run
button (
) on the Tool bar. (RAD runs the default application when the Run button is clicked.)
5.
In the main method, add the following statement before the println statement:
String sample = new String("Howdy from EmployeeApp");
This statement will create a String variable called sample and associate the text “Howdy from EmployeeApp”
to it. We will now change the println statement to print the text associated with the variable sample.
6.
In the println statement, replace “Howdy” with sample . (Make sure the double quotes
around the text Howdy are removed also.) The source code should look like Figure 1-17 .
Search WWH ::




Custom Search