O'Reilly logo

IntelliJ IDEA Essentials by Jarosław Krochmalski

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Live Templates

Live Templates lets you use the editor to insert frequently used code blocks into your source code.

Live Templates can be simple, parameterized, and surrounded. A simple template contains code blocks that will be expanded and inserted into the editor, replacing the abbreviation. Parameterized templates, on the other hand, have variables that will be filled automatically by IntelliJ IDEA or will prompt the user for input.

When a parameterized template is invoked and expanded in the editor, IntelliJ IDEA will suggest some predefined values for the defined variables. The surrounding templates expand before and after the selected code block. To insert a live template into the editor, just type the abbreviation and press the expand ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required