static import does the trick:
import static java.lang.System.out;
or, conversely, import each static method and field using
import static java.lang.System.*;
Addendum by @Steve C: note that @sfussenegger said this in a comment on my answer.
"Using this static import System.out is not suitable for simpler code with a single run."
Therefore, please do not think that he (or I) think that this decision is good practice.
sfussenegger Mar 23 '10 at 22:37 2010-03-23 22:37
source share