Friday, 2 December 2016

Write your first program in java

Friend you can start your programming journey with a simple program to understand the exection flow. But first you have some knowldge about Program Compilation and Execution. To Compile any java program there is a java command claaed "javac", And for execution "java". Now the question is how you can use this command.



If you have not set Path or Class Path in your computer machine then Click here to how to set path and class path variable in windows operating system.

Filename: HelloWorld.java




class HelloWorld{

      public static void main(String[] args){
        System.out.println("Welcome to java world: JavaGeeks");
               }
}

This code you can copy and paste in your notepad editor. Save this program with the name of HelloWorld.java

Open Command prompt and check wether path variable is set or not by using java command. if set then ok, otherwise go to above link.

CMD> javac HelloWorld.java
CMD> java HelloWorld
     Welcome to java world: JavaGeeks

Congratulations!!!! you have sucessfully executed your first java program.
Thanks for visiting our blog. If you like our post please comment and share with your friends.
Happy Coding....

1 comment:

Make Top Rank Blog