JAVA Program to Print Hello World statement

Here is a first Java program, in which we will print a very simple and basic JAVA program which will print a single statement or line i.e. Hello World. If you are new to JAVA programming, just simply copy this java program's source code in your text editor and then try to run it in CMD, you will get the  output.
So here is our first JAVA program :

class Hellocodext
{
public static void main (String args [] )
  {
    System.out.print("Hello World!! This is my First Java Program");
    }
    }


OUTPUT :
The output of above given program is as follows, which can also be viewed in the image below.

Hello World!! This is my First Java Program  

Here is the screenshot of the above program :


Note : Save the text file in which you will write the above code with the name of class and with .java extension, otherwise if you will use any name to save the file, then it will not be compiled by the compiler.

0 comments:

Post a Comment