Seems like you are asking difference between
System.console.write
and System.out.println
Here are few differences between System.console.write and System.out.println
System.console() returns null if your application is not run in a terminal (though you can handle this in your application)
System.console() provides methods for reading password without
echoing charactersSystem.out and System.err use the default platform encoding, while
the Console class output methods use the console encoding