JAVA Tutorial I – Hello World!

less than 1 minute read

You’ve set up the program successfully! So let’s look at the code without further ado!

public class HelloWorld { </p>

public static void main(String[] args) {

System.out.print(“Hello World!”);

 

}

 

}</td> </tr> </tbody> </table>

The code when colored looks like this:

NOTE: If you named your class something else than "HelloWorld", only copy everything below "public class HelloWorld {"

After you finished looking over the code and putting it into your program, go to Run > Run. You could also press Shift-Command-F11 in lieu of the mouse clicking.

At the bottom of the program there is a box called “Console” that will display your program if everything went according to plan. This is what it should look like in the Console.

Nice Work! If things didn't exactly work out, then look over the code again. If the problem still persists, just leave a note and I'll try and help you out.

<<Previous Page – Nice job! You’ve perfected a Hello World! for JAVA. If you had some trouble understanding the code, check it out – Next Page>>

Leave a Comment