Case1 :
The overloaded println which takes char[]
method processed your array internally and printed the String. Note that println()
has no such overloaded method for any other type of primitive array.
Case2 :
You are concatenating the array with String , hence before even processing by println, step 1 itself that your char arrays toString()
gets called and appended to string and the final output printed as a String.
So if you expand your second statement, the processing looks like
System.out.println("Output="+c.toString());
System.out.println("Output="+ "[C@15db9742");
System.out.println("Output=[C@15db9742");