In Intellij Idea 13.1, there is a shortcut way called “postfix code completion”.
So, to wrap an expression, object or variable with System.out.println
, you simply write its name, put a dot then write sout, then hit tab. So, for example:
new MyObject().sout + <tab>
will be converted to
System.out.println(new MyObject())
More examples:
"Hello World!".sout
int myVariable = 5;
myVariable.sout
You can get more information about postfix completions on this page:
http://blog.jetbrains.com/idea/2014/03/postfix-completion/