Search:

Type: Posts; User: Norm

Search: Search took 0.12 seconds.

  1. Replies
    5
    Views
    1,055

    Re: Is my code working

    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...
  2. Replies
    5
    Views
    1,055

    Re: Is my code working

    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...
Results 1 to 2 of 2