Search:

Type: Posts; User: Junky

Search: Search took 0.11 seconds.

  1. Replies
    8
    Views
    1,109

    Re: How to change my code?

    "array" was my general variable name for an array in my example. You of course would use the name of your variable. Common sense!
  2. Replies
    8
    Views
    1,109

    Re: How to change my code?

    I just told you why. You have declared myNumbers as a 2D array.

    Simple answer: you need two indices to access an element (array[x][y]).
    Long answer: a 2D array is a 1D array of 1D arrays. So each...
  3. Replies
    8
    Views
    1,109

    Re: How to change my code?

    myNumbers[i]=sc.nextInt();

    You have declared myNumbers as a 2D array but are trying to use it like a 1D array.
Results 1 to 3 of 3