I’m declaring a String array of [2][5]. Up until that point everything is fine. I can insert things into the array.
But when I insert an integer value into the array, ‘null’ keyword is automatically added before that int value.
So let’s say I inserted 5 into arrayName[1][0]. When I print it afterwards I get ‘null5’. Which is weird.
What exactly you guys think the problem is. Thanks, C@N.
The only way I can see this happening is if you use +=:
Cause if you just use
a[0] = 1;you would get compile error.The reason you get null5 is because you are concatenating the string “null” with 5:
So the question is what are you trying to achieve? Simply setting the value or adding to it?
If you just want to set it use:
If you do want to append to it: