Search:

Type: Posts; User: dabdi

Search: Search took 0.10 seconds.

  1. Replies
    4
    Views
    1,682

    Re: Syntax for 3D array enhanced

    I mean something like


    for(int i = 0;i < 2;i++)
    for(int j = 0;j < 3;j++)
    for(int k = 0;k < 4;k++)
    System.out.println(x[i][j][k])

    Personally I find this simpler than the...
  2. Replies
    4
    Views
    1,682

    Re: Syntax for 3D array enhanced

    The error message says it all. i should be a reference to a reference i.e with [][] instead of [], and j should have one []


    for(int [][] i : x)
    ...
    for(int[] j : i)

    But I would recommend...
Results 1 to 2 of 2