16 | | 4. Select File->Save and name the file Hello.java the name is important; it must be Hello.java with a capital H (case matters to Java). The name of the file must be the same as the name of the class (more on classes later) |
17 | | 5. In the left navigation window, you'll now see Hello.java with a red J icon next to it; right click on the Hello.java and select Run |
18 | | 6. A terminal window will open, the program will be compiled and then run; you'll see the output: Hello world! |
| 16 | 1. Select File->Save and name the file Hello.java the name is important; it must be Hello.java with a capital H (case matters to Java). The name of the file must be the same as the name of the class (more on classes later) |
| 17 | |
| 18 | === Run the program |
| 19 | There are multiple ways to run your program [[Image(JavaHello.jpg,align=right,50%,margin=10)]] |
| 20 | * In the editor, just below the first line, you'll see an option to click "Run" |
| 21 | * In the left navigation window, you can see the program file (Hellow.java) with a red J next to it indicating that it is a Java file; right click on Hello.java and select Run. |
| 22 | |
| 23 | When you run the program, a terminal window will open, the program will be compiled and then run; [[BR]] |
| 24 | In the terminal window below, you'll see the output: |
| 25 | {{{ Hello world! }}} |
| 26 | Congratulations, you just wrote your first Java program!!! |
| 27 | |
| 28 | === Extra Credit === |
| 29 | Change the text that's printed to say something different from ''Hello World''. Whatever you want printed must be between the double quotation marks. |