Simple basic HelloWorld JAVA Program code to print “Hello World”

Simple basic HelloWorld Program code for JAVA
Simple basic HelloWorld Program code for JAVA

Today, I am going to write a simple basic HelloWorld Program code in java. It is the most simplest program. It will just display a message like “Hello World” on the command screen after execution.

Let me first tell you about the default package. In java there is a default package named as java.lang.<em>  & can be imported by this code import java.lang.</em> . This package is default and it is included automatically by default even if you do not declare it in the code.

Now, Let us code the program :-

How to execute the program ?

  1. Save as: E:\HelloWorld.java
  2. Open cmd: Run -> cmd
  3. Compile: E:\> javac HelloWorld.java
  4. Execute (interpreter): E:\> java HelloWorld

Output:

Hello World

Journey of a Java program from Source code to Output

I have given a flow chart of java program below. It is actually the flow of execution of program including compilation and interpretation. It will help you understand that how we get output finally from initial source code.

Source code [HelloWorld.java] —> javac [Compiler] —> Byte code [HelloWorld.class] —> java [Interpreter] —> [Output]

erbhaveshkumar123

I am a Person who Loves to Do Innovative things.

You may also like...

Follow

Get the latest posts delivered to your mailbox: