Check out example codes for "print hello world in java". It will help you in understanding the concepts better.

Code Example 1

public class HelloWorld{

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

Code Example 2

public class Hello
{
  	public static void main(String[] args)
    {
      /*Tip System.out.println(); shortcut Type 'sysout'and press Tab */
      System.out.println("Hello world!");
    }
}

Code Example 3

printing hello world

Code Example 4

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

Code Example 5

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

Learn ReactJs, React Native from akashmittal.com