Simple Java Program to Print Hello World

Write a Simple Java Program to Print Hello World. It is a simple, basic, and traditional program to start Java programming language. It also helps you to understand the basic programming structure of Java.

Simple Java Program to Print Hello World

This simple Java program prints the hello world.

// Simple Java Programs to Print Hello World
public class HelloWorld {

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

}
Simple Java Program to Print Hello World 1

The Java System.out.println statement print the statement inside the double Quotes. So, the following Java statement prints the message Hello World.

System.out.println("\n Hello World ");

Simple Program to Print Hello World Multiple Times

In this program, we are using the Java For Loop to print the same statement multiple times. You can also use While Loop, or Do While to get the same result. Please refer Java For Loop, While Loop, and Do While to understand this program.

// Simple Java Program to Print Hello World
public class HelloWorld {

	public static void main(String[] args)
	{
		int i;
		for(i = 0; i <= 5; i++)
		{
			System.out.println("\n Hello World ");
		}	
	}
}

Java Hello World program output

 Hello World 

 Hello World 

 Hello World 

 Hello World 

 Hello World 

 Hello World 

Comments are closed.