John Jai wrote:That's not an error. Arrays class has overridden the toString() method to print that way. . . .
Has it? I am not convinced about your answer. What you are seeing is the output of an un-overridden toString() method. You will find that the only overridden member of an array type is clone().
Joined: Oct 13, 2005
I gave you an answer yesterday, which would have avoided any risk of going outwith the bounds of your arrays (you have 5 arrays, not one 2D array). I also suggested how you can avoid using i + 1 and i - 1.
I think this is a duplicate discussion, so I shall close it and ask everybody to continue on that thread I linked to on the first line of this post.