println() overloaded to print an array of characters as a string, so the 2nd print statement works correctly:
public void println(char[] x)
Prints an array of characters and then completes the line. This method behaves as if it calls print(char[]) and then println() .
Options:
x is an array of characters to print. A.
The first println() statement, on the other hand, concatenates the toString() array with another string. Since arrays do not override toString() , they default to an Object implementation , which is what you see.
source share