Monday, 14 August 2017

First Program in Java Heloo World!

Hello World! Program

Assuming that you are familiar with basic programming languages such as C we are now heading towards the actual programming in Java.
I am well aware that still basic definitions of OOP principles are not covered and I am going to cover them when we discuss the topic at that part.

Now to start with open ConEmu Prompt and type
code Hello.java
which is as shown in below picture.
 Wait till the visual code editor appears on the screen and you can start typing the program there.

class Hello
{
    public static void main(String[] args)
     {
          System.out.println("Hello World!");
      }
}

Save the file in a name Hello.java.
Now navigate to the window where the file is saved.

Enter the commands to invoke the java compiler and compile the java program, as shown in below figure.

 
               
So we get the output Hello World! on the output screen and you ran your first java code.

In the next post i will be explaining each keyword and their use in the Hello world program written before.

BYE!!.

No comments:

Post a Comment

             The `this` keyword in java The this keyword in java can be used for different purposes. Some of these are listed below. ...