From the course: IntelliJ IDEA Community Edition Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Generate boilerplate code

Generate boilerplate code

From the course: IntelliJ IDEA Community Edition Essential Training

Start my 1-month free trial

Generate boilerplate code

IntelliJ IDEA let's you generate code there are tools for generating new properties and new boiler plate code that's common in Java and other languages. Now to follow along, start with a simple class I've created a class called person and I'm going to add some fields to this class. I'll make them private I'll start by typing the word private and then the first one will be a string and I'll call it first name. Then I'll create another string and I'll call that last name and then I'll create an integer field and I'll name that age. In Java you'll typically want to create setter and getter methods and this will be the first example of how you can generate code. I'll place the cursor on that last line then I'll go to the menu and I'll choose code generate and notice that there's a keyboard shortcut associated with this action. Now I'll select getter and setter and I'll see this dialog pop-up I'll hold down the shift…

Contents