Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 92 - 2617_JSSPS_C-6
P. 92

    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.

                                                                              Right-click on the HelloWorld   2
                                                                              class icon.

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

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

                                                                   Output

                                                                    Hintbot

                         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.

                     90     Premium Edition-VI

| 87 88 89 90 91 92 93 94 95 96 97 |