Copying a two dimensional array - still uses references?
问题 I have got (IMHO) a strange behaviour in my code. I am currently implementing the minimax algorithm for a Tic Tac Toe game. In my "successor" method I want to determine all possible moves. Here's the code: private ArrayList<TicTacToeState[][]> successor(final TicTacToeState[][] field, TicTacToeState s) { ArrayList<TicTacToeState[][]> returnList = new ArrayList<TicTacToeState[][]>(); for (int i = 0; i < TicTacToeGame.FIELDSIZE; i++) { for (int j = 0; j < TicTacToeGame.FIELDSIZE; j++) { if