Java hello world Program - Your First Simple Step in Java Programming

In this example, you learn about the java hello world program. This java program is simple and first program in java. 

Explanation:

Firstly, You have to import the basic package and use the inbuilt class of this package. In this java program, you have to import the basic java package lang in this lang package one class is present known System and println is a function of System class. so, To invoke this println function we need one instance or object. out is a static member of System class and out is an instance of java.io.PrintStream. Whatever we write in double-quotes is print as it as to output.


java helloworld

Program:

import java.lang.*;
class simple{
public static void main(String args[]){
   System.out.println("HelloWorld"); 
   }
}
Program Output:

   HelloWorld

Happy Coding 😊

If you have any doubts, Please let me know

Previous Post Next Post

Contact Form