Check if a game of Tic-Tac-Toe has a winner
I would suggest this instead :

public boolean checkWin(){
    boolean diagLTRHasWinner = true;
    boolean diagRTLHasWinner = true;
    for(int j = 1; j &lt; this.size; j++){
        boolean columHasWinner = true;
        boolean rowHasWinner = true;
        for(int i =0; i &lt; this.size; i++){
            columHasWinner = columHasWinner &amp;&amp; (board[i][j] == board[i][j-1]);
            rowHasWinner = rowHasWinner &amp;&amp; (board[j][i] == board[j-1][i]);
        }
        if ((rowHasWinner &amp;&amp; board[j][0] != -1) || (columHasWinner &amp;&amp; board[0][j] != -1)){
            return true;
        }
        diagLTRHasWinner = diagLTRHasWinner  &amp;&amp; (board[j][j] == board[j-1][j-1]);
        diagRTLHasWinner = diagLTRHasWinner  &amp;&amp; (board[this.size - j][j] == board[this.size - j+1][j-1]);
    }
    return (diagRTLHasWinner &amp;&amp; board[0][0] != -1) || (diagLTRHasWinner &amp;&amp; board[this.size-1][0] != -1);
}


In order to reduce the number of loops, and objects allocated.
Besides the new code does not even count the element in the board, it just checks if we have a valid sequence of X or O, no matter which one, neither how many! It simply detects the end of the game !