String vs Character Array
A String provides higher-level operations such as searching, slicing, comparison, and concatenation.
A character array provides direct mutable access to individual characters.
Java String objects are immutable.
A char[] can be modified after creation.
Character arrays can sometimes be preferable when sensitive character data must be explicitly cleared from memory, although memory clearing has platform-specific limitations.