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
- Type
soutand pressTab. IntelliJ IDEA expands it toSystem.out.println();. - Type the argument: after the expansion, the cursor sits inside the parentheses, ready for input.
- Example: in the code below, typing
soutand pressingTabinsidemainproduces theSystem.out.printlnline.
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.
- System: A final class in the
java.langpackage. - out: A static member of
System, aPrintStreaminstance connected to console output. - println(): A
PrintStreammethod 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:
- Open Live Templates: Go to
File>Settings(orIntelliJ IDEA>Preferenceson macOS) >Editor>Live Templates. - Create a template: Click the
+icon and set an abbreviation, such assoutv. - Enter the template text, using as a variable placeholder:
- Define the context: choose where it applies, such as Java.
- Save it, then type
soutvfollowed byTabin Java code to expand it.
Typing it manually vs. using sout
| Aspect | Manual Method | IntelliJ IDEA Shortcut (sout) |
| Typing Involved | Type System.out.println(); | Type sout then Tab |
| Time Efficiency | Longer due to full syntax entry | Quicker due to automatic expansion |
| Ease of Use | Requires familiarity with syntax | Intuitive auto-completion |
| Customization | Not customizable inherently | Can create custom templates |
| Error Reduction | Prone to syntax errors | Minimizes typing errors |
Related reading
- Take n random elements from a ListE?
- Tensorflow Custom TFLite java.lang.NullPointerException Cannot allocate memory for the interpreter
- Tensorflow Java Multi-GPU inference
- Terminated Spring Boot App in Eclipse - Shutdown hook not called
- Terminating mvn spring-bootrun doesn't stop tomcat
- Testing a @KafkaListener using Spring Embedded Kafka
- Testing RabbitMQ with Spring and Mockito
- Testing two JSON objects for equality ignoring child order in Java

OOD Fundamentals
Master object-oriented design from first principles, SOLID, design patterns, and classic interview problems with hands-on coding.
View the courseData 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.