Pergunta de entrevista da empresa IBM

What would you choose for a password field in JAVA, a character array or String?

Resposta da entrevista

Sigiloso

9 de jun. de 2021

Char array should be preferred. Because if you define it as a string it will be written in string pool and will be available until next restart.