“Java Hello World” in intellij idea 19.3.3

“Java Hello World” in intellij idea 19.3.3

Hello World In JAVA

Hello World is the first step in any programming language. As people greet while meeting with any one, exactly the same way “Hello World” program is the first way to enter into programming world.

This example is based on intellij idea 19.3.3 so programming will be according to it but the same program can be carried to other versions too.

To create Hello World program carry out the following tasks

  1. Open intellij idea 19.3.3 and click on “Create New Project ” as it is highlighted in the image .

A dialog box will be opened for new project to add Library and Project SDK . Select the appropriate project SDK from your machine and click on next. This example uses jdk 13 so respective SDK is chosen for it. As shown in figure :

After Next is clicked a new dialog box appears which offers to choose for creating project from template as “Create Project From Template ” . Once it is checked a Main Class File is created itself in the project. It can be seen from the following figure

After clicking Next . Project Name and Project Location need to be specified, as seen in the figure below the name of the project is JavaProject inside directory /home/lenovo/IdeaProjects .

When the name of the project is specified click on Finish and a project module will be seen

After finish is clicked the project is ready with its basic modules .

  1. The .idea file is created by intellij idea itself .
  2. src is the folder where java classes locates
  3. .iml is the system file created by intellij idea
  4. and the External Libraries and Scratches Consoles are the Java Files created tor run the project.

After all the files are set and project are ready now its time to create a java file to write source codes. So right click on src folder and a small floating box will appear and click on New and to Java Class as shown in figure .

After this again a small floating box will appear to specify Name of java class . So any specific names can be given . As this is Hello World example so HelloWorld name is given as shown in figure

Once name is specified HelloWorld.java file is created inside src now we can write the following code there

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

Now after writing all these code . The code needs to be executed for the output so right click on the file and click on Run ‘HelloWorld.main()’

Once the file is executed the output can be seen as “Hello World “.

In this way Hello World Program can be done in intellij idea 19.3.3

Share this on facebook

Subscribe to our Youtube Channel

Leave a comment

Your email address will not be published. Required fields are marked *