java - Why is there difference between out.println and err.println? -
- system.class contains "out" , "err" object of printstream class.
- system.class declared static.
- println() overloaded method in printstream class have (out , err objects)
if execute system.out.println("xys"); , system.err.println("fdfd");
they both should work same out , err objects of same class except fact don't.
why out.println() prints in black , err.println() prints in red.
because ide you're using prints stderr in red, , stdout in black.
this has nothing java, , environment you're in–it's what's doing coloring, not java itself, doesn't care how output rendered.
Comments
Post a Comment