Eclipse has a useful hotkey to assign current line to a local variable - when I type for instance:
Math.random()
and press ALT + SHIFT + L
(Extract local variable), I can quickly change the line to
double random = Math.random();
I would like to use the same trick for printing it to std out, so that the Math.random()
is being changed to:
System.out.println(Math.random());
Currently the fastet way to to this is to type syso
and use content assist to use a template, but that requires manual copy pasting. Anyone knows a better way to do this?