System.out
is declared as public static final PrintStream out
.
But you can call System.setOut()
to reassign it.
Huh? How is this possible if it's final
?
(same point applies to System.in
and System.err
)
And more importantly, if you can mutate the public static final fields, what does this mean as far as the guarantees (if any) that final
gives you? (I never realized nor expected System.in/out/err behaved as final
variables)