Skip to content

Commit 7fa964b

Browse files
authored
Update Board.java
1 parent bce98e5 commit 7fa964b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tic_tac_toe/tictactoe/Board.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public Optional<Player> getWinner() {
2929
// Check columns for three in a column
3030
for (int j = 0; j < grid[0].length; j++) {
3131
final Player first = grid[0][j];
32-
int finalJ = j; //streams require a final object
32+
int finalJ = j; // local variable must be effectively final to pass to lambda
3333
if (first != null && Arrays.stream(grid).allMatch(row -> row[finalJ] == first)) {
3434
return Optional.of(first);
3535
}

0 commit comments

Comments
 (0)