Saturday, February 2, 2019

Hello World || First java program Example -

 Hello World Example



we will learn how to write the simple program of java. We can write a simple hello java program easily after installing the JDK.

To create a simple java program, you need to create a class that contains the main method. Let's understand the requirement first.

For executing any java program, you need to
  • Install the JDK if you don't have installed it, download the JDK and install it.
  • Set path of the jdk/bin directory. 
  • Create the java program
  • Compile and run the java program

Hello World Example


  1. class Simplex{  
  2.     public static void main(String args[]){  
  3.      System.out.println("Hello Java world");  
  4.     }  
  5. }



Note - here class is a keyword and Simplex is a class name. public static void main is a main function of program here exection of java program starts.System.out.println method used to print output or value on the console.


For run this program save this file with class name.java 
save- Simple.java 

Compile - javac Simplex .java
Execute-  java Simplex

1 comment:

  1. Hi, thanks for your blog, if you want to learn about programming languages like java, php, android app, embedded system etc. I think this training institute is the best one.
    Best java training in coimbatore
    Android training in coimbatore
    Networking training in coimbatore

    ReplyDelete

Hello World || First java program Example -

 Hello World Example we will learn how to write the simple program of java. We can write a simple hello java program easily after i...