返回数组的内存地址而不是值

时间:2016-03-10 16:48:30

标签: java

public int[][] updateGame(String[] inarr, int c) {

  int[][] userGuess = new int[10][4];

  for (int i = 0; i < c; i++) {
    for (int j = 0; j <= 3; j++) {
      userGuess[i][j] = Integer.parseInt(inarr[j]);


      System.out.println("user guess in for loop: " + userGuess[i][j]);

      //return userGuess[i][j];
    }

  }

  //System.out.println("user guess in method:"+userGuess);

  return userGuess;

}

它只返回数组的地址

0 个答案:

没有答案