I've come across what appears to be an interesting bug...
For one of my classes, I need to write a program that simulates the old "x students going down a hallway closing lockers every x interval" scenario. However, an interesting twist is that the question requires there to be an equal number of students and lockers up to 100. So I decided to use an array, where the user input a number - which is then used to set up the array size, for-loop conditions, etc. etc... you get the picture, right?
Anyway, my code compiles, but when run it puts out something like:
[I@36ae2282
Someone (in another thread/question/whatever-you-call-it) stated that this is the physical location of the array in the system memory, and to get the actual numbers from the array the .getNums()
method would be required. My problem is: the .getNums()
method doesn't seem to exist in Java (perhaps it's part of another language?), so what is the next best alternative or solution?