#[Ljava.lang.String;@5b6f7412 error

1 messages · Page 1 of 1 (latest)

spring briar
#

i tried googling how to fix this but I can't find any solutions to it. The code is to ask user to enter the
student’s Id number whom they want to edit, then update the new student info in the array, anyone knows how to fix it pls?

edgy shaleBOT
#

<@&987246399047479336> please have a look, thanks.

edgy shaleBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

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.

manic widget
#

@spring briar is names an array? you would need to use Arrays.toString() method to print it on console

spring briar
#

yes names is an array

manic widget
#

or if you want to just print one value from array, then index it

spring briar
#

how do I do that?

manic widget
#

do you wanna print whole array or just one value?

spring briar
#

oh the whole array

blissful flicker
#

that method will turn it into a readable format

manic widget
#

dont forget to import Arrays class as well

spring briar
#

is this what you meant? sorry I haven't learnt that

manic widget
#

java.util.Arrays

spring briar
#

it doesn't seem to work?

blissful flicker
#

it does work

#

look at the beginning

spring briar
#

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?

manic widget
spring briar
#

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

manic widget
#

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"

spring briar
#

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

manic widget
#

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

spring briar
#

okay i think i got it

#

thanks a lot for your help!