Character arrays (char[]
) can be cleared after use by setting each character to zero and Strings not. If someone can somehow see the memory image, they can see a password in plain text if Strings are used, but if char[]
is used, after purging data with 0's, the password is secure.