Hello World Java Example

Every beginner who starts programming in any language writes Hello World Program. Java Programmer is no exception for the Hello World Java Example. Below is the java version of the Hello World Java Example.

* Created on 09-2011 Copyright(c) https://kodehelp.com All Rights Reserved.
package com.kodehelp.java.basic;

 * Created by https://kodehelp.com Date: 9/22/11
public class HelloWorld {
    public static void main(String[] args) {
        // Print Hello World on the console
        System.out.println("Hello World!");

To start with the Hello World java program you need to create a HelloWorld.java file, Once you created the file write class HelloWorld. The name of the class and the name of the file should be the same and it is case sensitive. We have also added the first line for package declaration, which means HelloWorld.java file will be placed com\kodehelp\java\basic directory

A main(String[] args) method is the execution entry point for any java program and we have System.out.println() method to print the Hello World on the console output.