Pregunta de entrevista de IBM

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

Respuesta de la entrevista

Anónimo

9 jun 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.