Could you show us your code right now, both for populating the array and for printing the result?
It would also be useful if you could show us the output and the expected output.
Until then I can...
Type: Posts; User: Cornix
Could you show us your code right now, both for populating the array and for printing the result?
It would also be useful if you could show us the output and the expected output.
Until then I can...
Well, that error makes a lot of sense.
Look at your code, you declare an array with a size of 10.
But you try to populate it with a while-loop that runs for as long as your scanner can read more...
You can use main as a name for any variable or method. You can also declare several main methods in your code.
There is absolutely no problem with that.
@saeedeh:
I do not see any critical...