Domanda

Hey guys i have seen many ways in java to do the same things.

Please tell me what is the difference between console.println or console.readLine and system.out.format whichever is the closest match.

È stato utile?

Soluzione

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 characters

  • System.out and System.err use the default platform encoding, while
    the Console class output methods use the console encoding

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top