Strange output when converting double arrays to string arrays, any help?
There doesn't seem to be anything wrong with my code (as far as I know), but it doesn't give the output I want, can someone help?
46 Replies
⌛
This post has been reserved for your question.
Hey @B3251! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
would i just call a tostring function in the driver?
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
i have this in a separate Driver class
because this is one part of several questions
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
idk how to use the Arrays wrapper class
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
intelliJ ide?
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
oh
no i use BlueJ that's what my professor wants us to use
Its probably not the best though
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
well
yeah i dont know about the whole Array wrapping bit
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
I would put this in the actual function program class and not the Driver class? I do need to return something which is confusing me
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Here's what I have
everything above is the same except I imported Arrays
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
oh, is that what I would be returning?
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Not sure if this is what you wanted me to do
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Yeah i suppose actually
but
i did try to return letterGrades before and the result was this
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
yeah i just dont know what to do
like print out the array?
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
okay
sorry im just confused at the moment, I just have no clue how to make it actually print out the Array in the letter form
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
like this?
since when i do this and try running it doesn't run
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
No errors when the program is compiled (no syntax errors) just have a runtime error or osmething
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
that isnt it
ty for the suggestion
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Arrays are objects, that's why you can toString them, even if the default implementation sucks
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
https://docs.oracle.com/javase/specs/jls/se7/html/jls-10.html
First sentence
It's just that the implementations they have for
equals
, hashCode
and toString
are garbageUnknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Still need help
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Be. More. Specific.
I got it nvm
Post Closed
This post has been closed by <@1057008593100083260>.