why boolean argument is given in the countNQueen method
Boolean argument
if(isItsafe((board,row,col)){
board[row][col]=true;
count=count+countNQueens(board,row +1);
board[row][col]=false;
}
if your doubt is regarding this then we use it for backtraking when we place a queen at board[row][col] then we mark it as true indicating that we have place a queen here.
and recursively call the countNQueens function but when we backtrack then we remove the queen placed in board[row][col] by marking it as true.