First JAVA Program (Hello, How are you?)

Java is a high level programming language and it is used to develop the robust application. Java application program is platform independent and can be run on any operating System. Writing Hello, How are you ? program is very simple. To write the Hello Hello, How are you ? program you need simple text editor like note pad and jdk must be install in your machine for compiling and running. Hello Hello, How are you ? program is the first step of java programming language. Be careful when you write the java code in your text pad because java is a case sensitive programming language. Please see example of this.

For Example

hello  != (not equal to) Hello

Write the following code into your note pad to the Hello, How are you ? program .

class Worlds{
public static void main(String[] args){
System.out.println(“Hello, How are you ? “);
}
}

Save the file and Please remember the location where you save your file. In this example we have saved the file in the “C:\javatutorial\ForBeginner” directory. The file name should be match the class name and to save the file give the .java extension . Example:  Worlds.java

Now open the command prompt to compile the Worlds.java program. Go to the directory where you have saved the file ( in our case C:\javatutorial\ForBeginner>) and issue the following command to compile the program:

C:\javatutorial\ForBeginner>javac Worlds.java

javac is a compiler in the java Language. Java compiler change the programming Language into machinery language. So that the java virtual can understand it. Once the compilation is successful a new file will be created with the name Worlds.class.  To run the program issue the following command on command prompt:

C:\javatutorial\ForBeginner>java Worlds

You will see the following result on the command prompt. Here is the output:::

Hello, How are you ?

That’s  it….