From the course: IntelliJ IDEA Community Edition Essential Training

Create new packages, classes, and interfaces

From the course: IntelliJ IDEA Community Edition Essential Training

Start my 1-month free trial

Create new packages, classes, and interfaces

- [Instructor] Intellij IDEA makes it easy to create new components in your application. If you are working in Java and you want to organize your code, you might want to create a new package. And you can do that easily by right clicking on an existing package in the project window, selecting new and then package. You'll see this dialog pop-up and you can add a new sub package under the existing package. For example, I might want a model package or you can create one that's more deeply nested. I'm just going to create the model package and then I'll right click there and create a new class. Now when you create a class you're actually saying I want to create a new component. And you can choose in this dialogue whether it's going to be a class in interface an enum or enumeration or a custom annotation. I'll create a class called person, and that creates the new file. You can also create new components from the menu by selecting file, new. And once again you'll see Java class there. If you are working in another language and you've installed the plugin for that language you'll see entries for that language. So for example, this would let me create a new Kotlin file class interface, enumeration or object. That's how easy it is to create new components for your software. And again you do that by going to the project window and selecting where you want that component to go or you can go from the menu and select file new from there.

Contents