Site icon TestingDocs.com

Create Package in IntelliJ IDEA IDE

Overview

In this tutorial, we will learn steps to Create Package in a Java project with IntelliJ IDEA IDE.
Learn the steps to create a Java project in IntelliJ IDE:

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

Create Package

Steps to create a new Package in IntelliJ are as follows:

Open the Project.

Choose from the menu File >> New >> Package.

Alternatively, right-click on the src folder and choose New >> Package.

The package has the folder icon in the menu.

Enter the new package name and hit Enter.

For example: com.testingdocs.sample

The left Project window will display the newly created package.

We can select the package in the left Project window to create project artifacts like Classes, Interfaces,Annotations, etc inside the newly created package.

 

 

The package declaration statement would appear as the first statement in these artifacts:

package com.testingdocs.sample;

Under the hood, the IDE would create the following folder structure for the package

<JavaProject>\src\com\testingdocs\sample .

That’s it. We have successfully created a new package in IntelliJ IDE.

IntelliJ IDEA Tutorials

IntelliJ IDE tutorials on this website can be found at:

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

More information on IntelliJ IDE visit the official website:

https://www.jetbrains.com/idea

Exit mobile version