Yes, it would compile without any errors. Maybe a really good compiler could look at the code and give an error or warning, but none that I know of. Normally code uses a variable as an index...
Type: Posts; User: Norm
Yes, it would compile without any errors. Maybe a really good compiler could look at the code and give an error or warning, but none that I know of. Normally code uses a variable as an index...
Here's code that will get that error:
int[] intA = new int[2]; // has 2 elements: valid indexes are: 0 and 1
intA[3] = 4; // ERROR: 3 is out of bounds
intA[-1] = 55; // ERROR: -1 is out of...