int next[][][] = new int[][][]{};
    int next[0][][] = new int[0][][]{
                               {0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},
                               {1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                               {0,1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0},
                               {0,0,1,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0},
                               {0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                               {0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0},
                               {0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                               {0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                               {0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0},
                               {0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0},
                               {0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0},
                               {0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0},
                               {0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0},
                               {1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0},
                               {0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0},
                               {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0},
                               {0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},
                               {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0},
                               {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0},
                               {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1},
                               {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0}
                           };

解决方案 »

  1.   

    you need to specify the array size when you declare it.
      

  2.   

    还有这个函数    public int[][] setdata(int i)
        {
            return next[i][][];
        }
    怎么弄呢?很菜的问题,不知到哪里找。谢谢帮忙了。
      

  3.   

    2维不就可以了。
    int next[][] = new int[][]{
      //你上面的数据
    }另外,你上面的函数显然是getdata
      

  4.   

    前面三维数组有什么用么??
    没有的话用2维取吧
    报错是因为你数组初始化没定size
      

  5.   

    二维数组的初始化:
    int next[][]=new int[][]{{1,2},{2,1}},
    三维数组的初始化:
    int next[][][]=new int[][][]{{{1,2},{2,1}},{{3,4},{5,6}}},楼主的数组是三维数组,但赋值的时候却用了二维数组的赋值方式,所以发生错误.你可以:
    1.把数组变成二维数组

    2.按照三维数组的赋值方式赋值