When you do + Playername
, you're printing the array itself, not an element in the array. When you try to concatenate an object to a string, the object's toString()
method is called, and arrays inherit their toString()
from Object
:
public String toString() {
return getClass().getName() + "@" + Integer.toHexString(hashCode());
}
And that's probably not what you wanted.
You might have wanted to do Playername[i]
.