October 2011
Beginner
432 pages
10h 18m
English
After you’ve created the Java class Spartacus.java and compiled it successfully, you can run it within NetBeans in two ways:
• Choose Run, Run File from the menu.
• Right-click Spartacus.java in the Projects pane, and choose Run File.
When you run a Java class, its main() method is called by the compiler. The string “I am Spartacus!” appears in the Output pane, as shown in Figure A.4.
Figure A.4. Output of the Spartacus application.
A Java class must have a main() method to be run. If you attempt to run a class that lacks one, NetBeans responds with an error.
Read now
Unlock full access