Your First Java Program

212,893pages on
this wiki
Add New Page
Add New Page Discuss this page1

Your First Java Program

Here you will learn how to create your first Java program that will print the text

    "Hello World"

Create the following file in a text editor, such as notepad. Do not use an office text editor, such as word.

Add the following text to your file:

     public class first{
            public static void main(String[]args){
            System.out.println("Hello World");

Don't worry what this means, we'll go over it later.

Make sure that a Java complier is installed on your PC.

Save this as "first.txt", open a command prompt, and type


Then type

     java first

With any luck, you will see the following text:

    Hello World.


Also on Fandom

Random wikia