I was looking at someone's code and saw that he repeatedly declared
PrintStream out = System.out;
and later called
out.println("blah");
I actually thought this was kind of neat. Is this a common practice? Was he just being fancy?
This is a reasonable approach. He is basically creating an alias for System.out
. There are a number of advantages: