Below is the code for a simple java program to get you started.

Below is the code for a simple java program to get you started.

class FirstProgram

{

     public static void main(String args[])

     {

          System.out.println(”This is the first java program”);

     }

}

Save the above code with the file name as: FirstProgram.java

Now, Compile the program on command prompt with the following command:

javac FirstProgram.java

Execute the code with the command:

java FirstProgram

Now you should get the output on command prompt as:

This is the first java program. fir

2
Liked it
Comments (2)
  • OhSugar on Jun 16, 2009

    I have to be honest, I still don’t understand java. I will reread this. Thanks for sharing.

  • Caroline1957 on Jun 16, 2009

    I must try it I dont know Java.

Leave a Comment

Hi there!

Hello! Welcome to Authspot, the spot for creative writing.
Read some stories and poems, and be sure to subscribe to our feed!

Find the Spot

Loading