Site icon TestingDocs.com

Create New Class in IntelliJ IDEA

Overview

In this tutorial, we will learn the steps to create new class in a Java project using IntelliJ IDEA IDE.

Create Java Project in IntelliJ:

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

Create New Class

It’s recommended to create a package before creating a class. Steps to create a package:

https://www.testingdocs.com/create-package-in-intellij-idea-ide/

Select the package from the left Project window.

Choose File >> New >> Java Class

Alternatively, choose the package and right-click on the package, choose New >> Java Class.

 

 

Enter the new class name and hit Enter button. For Example, HelloWorld

 

This will create a class under the selected package. The filename HelloWorld.java would be created in the project under the directory

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

That’s it. We have successfully created a new java class in IntelliJ IDE. Now, we can add Java code to the class.

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