Create your First Program in Java

To write your first program, you’ll need:

  1. The Java SE Development Kit (JDK )

    You can download from the sun website. (Make sure you download the JDK, not the JRE.) Do check installation instructions.

  2. A text editor – Notepad & Command Prompt for compile and execute.

Your first application,, will simply display “This is a New Java Program”. To create this program, you will:

  • Create a source file using Notepad; write the code and save as ” “
This is a New Java program.
Call this file “”.
*/ class New

// Your program begins with a call to main().

public static void main(String args[])
System.out.println(“This is a New Java Program.”);


  • Compile the source file into a .class file. ( You can use Command prompt)

    The Java programming language compiler (javac) takes your source file and translates its text into instructions that the Java virtual machine can understand. The instructions contained within this file are known as bytecodes.

  • Run the program

    The Java application launcher tool (java) uses the Java virtual machine to run your application.

Explanation of First Program in Java

What do you think? Please reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s