TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

IntelliJ IDEA

Hello World Application using IntelliJ IDE

IntelliJ Tutorials

Overview

In this tutorial, we would go through the basics of working with IntelliJ IDEA IDE. At the end of this post, you should be able to run a simple java program using the IDE. We assume that Java and IntelliJ are installed on the machine.

A common way to test something new is to create a simple “Hello World” program with the language or tools we are learning. So, let’s get started!

Install IntelliJ

https://www.testingdocs.com/downloading-and-installing-intellij-idea-ide/

Flowchart

 

Java Hello World

Create a New Project

To create a project in IntelliJ, follow the steps:

https://www.testingdocs.com/create-a-new-project-in-intellij-ide/

New Java class

The next step is to create a New class. In the project side window, right-click on the src folder and choose

Right-click >> New >> Java class

Type the class name, for example, HelloWorld.

 

It’s encouraged to specify the package for your class. We have specified “com.testingdocs.demo” as the package. Java packages are like directories or folders that hold Java classes to avoid name conflicts. We can group relevant classes into one package. We cannot have a “HelloWorld” class twice in the same package  “com.testingdocs.demo“. However, we can have a ”HelloWorld” class in a different package let’s say “com.testingdocs.sampledemo“.

Other users/programs need to import the packages to use the functionality implemented by the classes. 

 

Java Package and Class

 

Hello World Application

package com.testingdocs.demo;

public class HelloWorld {

 public static void main(String[] args) {
 // write your code here
 System.out.println("Hello world!");
 }
}

 

Now that you have your class, in the main() method, add the following statement to print “Hello World!” on the console. Then save your changes

Run the Application

To run your application, right-click on your class and select Run main. The Console view should appear at the bottom and display the “Hello, world!” output.

Console output

 

 

After the java application run, you would see the console output that displays “Hello World!”. 

That’s it! You have successfully created a Hello World Java application using IntelliJ IDEA.

—

IntelliJ Tutorials on this website can be found at:

https://www.testingdocs.com/intellij-ide-tutorials

More information on IntelliJ on JetBrains website:

https://www.jetbrains.com/idea

Related Posts

JetBrains Toolbox Application Download

IntelliJ IDEA /

Install JetBrains Toolbox App on Windows 11

Download IntelliJ IDEA Windows11

IntelliJ IDEA /

Download IntelliJ IDE on Windows 11

Programs and Fetures Win11 IntelliJ

IntelliJ IDEA /

Uninstall IntelliJ IDEA on Windows 11

IntelliJ Update Notification

IntelliJ IDEA /

Update IntelliJ IDEA on Windows

JetBrains Space IntelliJ IDE

IntelliJ IDEA /

IntelliJ IDEA Features

‹ Create a New Project in IntelliJ IDE› Install IntelliJ IDEA on Windows 10

Recent Posts

  • MS Access Data Types
  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • Build & Run CLion Project
  • Create New CLion C Project on Windows
  • Configure CLion Toolchains on Windows
  • Launch CLion IDE on Windows
  • Activate CLion IDE
  • CLion IDE for C/C++ Development

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com

Go to mobile version