Simple version of the Game Of Life This is just a very simple version of the Game of Life made in Java. Please let me know how I could have improved this. I am also hoping for some feedback on how the formatting and conventions are because I would like my code to be readable and neat.

public class GameOfLife
{
    private boolean[][] board;
    private int maxRow, maxCol;

    public GameOfLife(boolean[][] board)
    {
        if(board != null)
            this.board = board;
        else
            this.board = new boolean[1][1];

        this.maxRow = this.board.length;
        this.maxCol = this.board[0].length;
    }

    public void calculateNextGeneration()
    {
        boolean[][] nextBoard = new boolean[maxRow][maxCol];

        for(int row = 0; row &lt; maxRow; row++)
        {
            for(int col = 0; col &lt; maxCol; col++)
            {
                nextBoard[row][col] = nextState(row, col);
            }
        }


        board = nextBoard;
    }

    public void print()
    {
        for(int row = 0; row &lt; maxRow; row++)
        {
            for(int col = 0; col &lt; maxCol; col++)
            {
                if(isAlive(row, col))
                    System.out.print("*");
                else
                    System.out.print(".");  
            }
            System.out.println();
        }
    }

    public void setAlive(int row, int col, boolean isAlive)
    {
        if(inBounds(row, col))
            board[row][col] = isAlive;
    }

    public boolean isAlive(int row, int col)
    {
        if(inBounds(row, col))
            return board[row][col];
        else
            return false;
    }

    private boolean nextState(int rowPos, int colPos)
    {
        int alive = 0;

        for(int row = rowPos - 1; row &lt;= rowPos + 1; row++)
        {
            for(int col = colPos - 1; col &lt;= colPos + 1; col++)
            {
                if(!inBounds(row, col) || (row == rowPos &amp;&amp; col == colPos))
                    continue;

                if(isAlive(row, col))
                    alive++;
            }
        }

        if(alive == 3)
            return true;
        else if(isAlive(rowPos, colPos) &amp;&amp; alive == 2)
            return true;
        else
            return false;
    }

    private boolean inBounds(int row, int col)
    {
        if(row &lt; 0 || row &gt;= maxRow || col &lt; 0 || col &gt;= maxCol)
            return false;
        else
            return true;
    }
}
just some minor things...

private boolean inBounds(int row, int col)
{
    if(row &lt; 0 || row &gt;= maxRow || col &lt; 0 || col &gt;= maxCol)
        return false;
    else
        return true;
}


could be more clear if you directly return the value

private boolean inBounds(int row, int col)
{
    return (row &gt;= 0 &amp;&amp; row &lt; maxRow &amp;&amp; col &gt;= 0 &amp;&amp; col &lt; maxCol)
}


the same matters for isAlive() 

public boolean isAlive(int row, int col)
{
    return inBounds(row, col) &amp;&amp; board[row][col];
}


another thing is the name of the variable maxRows and maxColumns is not exactly what they are, i would use the simple forms for them rows and columns since they are rows and columns... 

that would not even make conflicts for your iterations for(int row = 0; row &lt; rows; row++)...

remove your whitespace, that makes reading easier...