It is generally recommended to use a character array (char[]) instead of a string (String) to store passwords in Java, due to the way that strings are handled in memory. Strings in Java are immutable, meaning that once a string ...
Home/Why is char[] preferred over String for passwords?