Website For Developers

First Program in Java



If you are new in Java programming and you don't even code a single line, or you are very beginner than follow the following steps of installation of "JDK" and "IDE".


Step#1: JDK Download and Installation

Step#2: Make/Update a Path of JDK

Step#3: Install IDE (Compiler) for Java Coding and Development

Step#4: Hello World (First Program) Program in NetBeans

Image Issued

First look of your project


/*
* To change the license header, choose License Headers in the Project Properties.
* To change the template file, choose Tools - Templates
* Open the template in editor.
*/

package hello.world;

/**
*
* @author
*/

public class HelloWorld {

/**
* @param args command line arguments
*/

public static void main(String[] args) {
// TODO the code application logic here
}

}

Now let run your first Java program.

package hello.world;

public class HelloWorld {

public static void main(String[] args) {
System.out.println(" This is my first program in java language. ");
}
}

Output

This is my first program in java language.

Remember: If you are using notepad for java coding, then it is highly recommended that you should do coding on IDE. Because it saves time and let you do coding in a friendly environment. Like: providing syntax highlighting, assemblies referring etc.