A String in java is merely an object around an array of chars. Hence a
char[]
is identical to an unboxed String with the same characters. By creating a new String from your array of characters
new String(char[])
you are essentially telling the compiler to autobox a String object around your array of characters.