IntelliJ IDEA
System.out.println shortcut
IntelliJ tips
Java development
coding productivity

System.out.println shortcut in IntelliJ IDEA (sout)

Codemia Knowledge Hub ·

In IntelliJ IDEA, type sout and press Tab. The live template expands to System.out.println(); and puts the cursor inside the parentheses, ready for your argument. It saves typing the full statement every time, so you can focus on the logic rather than repetitive syntax.

Using the sout live template

  1. Type sout and press Tab. IntelliJ IDEA expands it to System.out.println();.
  2. Type the argument: after the expansion, the cursor sits inside the parentheses, ready for input.
  3. Example: in the code below, typing sout and pressing Tab inside main produces the System.out.println line.
java
1   public class HelloWorld {
2
3       public static void main(String[] args) {
4           sout  // Type 'sout' and press 'Tab'
5           // Output: System.out.println();
6           System.out.println("Hello, IntelliJ IDEA!"); // Example Output
7       }
8   }

What System.out.println() is

System.out.println() prints its argument to the console and appends a newline, which makes it one of the most used Java statements for debugging and tracing execution.

java
System.out.println("Hello, World!");
  • System: A final class in the java.lang package.
  • out: A static member of System, a PrintStream instance connected to console output.
  • println(): A PrintStream method that prints its argument followed by a newline.

Creating a custom live template

sout is one of IntelliJ IDEA's live templates, and you can customize them or define your own shortcuts tailored to your needs, for example soutv to print a variable's name and value:

  1. Open Live Templates: Go to File > Settings (or IntelliJ IDEA > Preferences on macOS) > Editor > Live Templates.
  2. Create a template: Click the + icon and set an abbreviation, such as soutv.
  3. Enter the template text, using EXPREXPR as a variable placeholder:
 
     System.out.println("$EXPR$ = " + $EXPR$);
  1. Define the context: choose where it applies, such as Java.
  2. Save it, then type soutv followed by Tab in Java code to expand it.

Typing it manually vs. using sout

AspectManual MethodIntelliJ IDEA Shortcut (sout)
Typing InvolvedType System.out.println();Type sout then Tab
Time EfficiencyLonger due to full syntax entryQuicker due to automatic expansion
Ease of UseRequires familiarity with syntaxIntuitive auto-completion
CustomizationNot customizable inherentlyCan create custom templates
Error ReductionProne to syntax errorsMinimizes typing errors

Course
Intermediate
27 lessons
14 hours
OOD Fundamentals

Master object-oriented design from first principles, SOLID, design patterns, and classic interview problems with hands-on coding.

View the course
Data Structures & Algorithms practice on Codemia

Step through 300+ coding interview problems with animated visualisers that show the data structure changing as the code runs. The Blind 75 are free.

Practice algorithms