System.out.println -> out.println + import static, Novice Tip

Let’s say you wanted to convert all your System.out.println to
out.println with an import static java.lang.System.out; at the top.
How do you get all the imports only in the files where needed? Just
use a bulk regex search replace to insert imports just after the
package statement on all files. Then do a bulk Optimise
Imports/Reformat code to tidy the imports. The optimise discards the
unneeded imports, sorts and aligns them.
Roedy Green Canadian Mind Products
"Don't worry about people stealing an idea; if it's original, you'll
have to shove it down their throats."
~ Howard Aiken (born: 1900-03-08 died: 1973-03-14 at age: 73)


Please sign in to leave a comment.