Page 59 - TP_iPlus_V2.1_Class8
P. 59

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 making a single change. 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 the given steps:


                           1  Click on the Compile button.











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








                                                                           2  Right-click on the
                                                                           HelloWorld class icon.















                         3  Select the void main (String[]args) option.         4  Click on the OK button.


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











                                                                Output
                    Quick Byte

                     If you want to make any changes to a program, then double-click on the class icon and
                     make the required changes. After making the required changes, you need to compile the

                     program again.



                                                                                                                  57
                                                                                               Program Coding
   54   55   56   57   58   59   60   61   62   63   64