#[Ljava.lang.String;@5b6f7412 error
1 messages · Page 1 of 1 (latest)
<@&987246399047479336> please have a look, thanks.
While you are waiting for getting help, here are some tips to improve your experience:
If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.
Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.
@spring briar is names an array? you would need to use Arrays.toString() method to print it on console
yes names is an array
or if you want to just print one value from array, then index it
how do I do that?
do you wanna print whole array or just one value?
oh the whole array
yeah then like bee said you gotta wrap it in Arrays.toString(...)
that method will turn it into a readable format
dont forget to import Arrays class as well
is this what you meant? sorry I haven't learnt that
yes and you have to import the class as well
java.util.Arrays
it doesn't seem to work?
it only printed the values except for the one I entered, but I'm trying to replace the old name in the array to the new one that i entered
or is there a simpler way to do it?
im confused, could you tell us more about what is that you wanna do when user enters the value?
so for example the name stored in names[j] in sarah, but now I wanna change it to emma
emma is the name that the user inputs
You can replace the value at particular index, like say names[0] has "sarah" as its value then to change that you need to replace it with some other value like names[0]="emma"
i did this step already, names[j]=updatedName, (updatedName is the new name the user inputs)
but i just wanna print the whole array out to check if it works or not
well like i mentioned, Arrays.toString(inputArrayHere) prints your whole array, if you just wanna print say a particular value then do names[index] inside sysout