Page 57 - iprime_V2.2_class8
P. 57

Compiling and Running a Program

                 When we compile a Java program, the Java compiler converts it into bytecode. This bytecode
                 is a platform-independent code which can run on any machine without modifications. A Java
                 compiler is a program that translates the source code written by us into machine-readable code.

                 To compile and run a program, follow these steps:
                 Step 1  Click on the Compile button located at the top of the code editor window.










                                                          Compiling a Program
                 If your program is successfully compiled, the message Class compiled – no syntax errors will
                 appear at the bottom of the code editor window.





                 Step 2  Go to the main window of your project and right-click on the HelloWorld class icon. A
                         shortcut menu will appear.
                 Step 3  Select the void main(String[] args) option. The Method Call dialog box will appear.

                 Step 4  Click on OK.





















                                     Running a Program                           Method Call Dialog Box

                 The output of your program will appear in the Terminal Window as:














                                                                Output


                                                                                               Program Coding      55
   52   53   54   55   56   57   58   59   60   61   62