Saturday, August 31, 2019

input - Java: Console class







Reading the java documentation, i found this statement about Console class





First, it suppresses echoing, so the password is not visible on the user's screen. Second, readPassword returns a character array, not a String, so the password can be overwritten, removing it from memory as soon as it is no longer needed.




Why a character array can be overwritten and a String not?
Or maybe a character array can be overwritted in a more simple way?

No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...