I want to put the array in the list and print out the list.
If you run the code below, " The error [Ljava.lang.String;@76ed5528] is displayed.
When printing, the same result comes out even if you attach toString(), but the cause is not found even if you google it. Please give us feedback.java
I don't know what
list2 is, so I'm answering with a guess.
[Ljava.lang.String;@76ed5528 is not an error. All classes in Java inherit the Object, and if
toString() is not defined separately in the class you are trying to output, call
Object.toString() looks like this:
It's supposed to print out the class name and hash value, right?
If it had been properly written to output the variable containing the String class, the string would have been printed, not
[Ljava.lang.String;@76ed5528, but I think it was trying to print the list as it is.
Arrays.toString() when you want to print the list as it is.
© 2022 pinfo. All rights reserved.