Question 20
Back to Exercise
Why do security guidelines prefer char[] over String for passwords?
- A char[] is faster
- B A char array can be overwritten after use; an immutable String stays in memory until garbage collected Correct
- C Strings cannot hold symbols
- D char[] is encrypted
Correct Answer: Option B
That is why Console.readPassword returns char[].
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!