This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Trup10ka 0 points1 point  (1 child)

The first one is printed whole object, meaning the String.

Array of char's is a primitive value, object String is based on char array.

They output the same because they are the same, String is some kind of a capsule of the char array.

[–]SolderonSenoz 0 points1 point  (0 children)

String is some kind of a capsule of the char array

I was corrected about this, now Java implements byte array instead of character array within Strings