2. $n$ is a positive integer, the number of integer solutions to $x^{2}+x y+y^{2}=n$ is ( ).
(A) a multiple of 4
(B) a multiple of 6
(C) a multiple of 2
(D) a multiple of 8
2. (B).

If $(x, y)$ is a solution, then $(x+y, -x)$, $(y, -x-y)$, $(-x, -y)$, $(-x-y, x)$, $(-y, x+y)$ are also solutions.

Since $x, y$ are not both zero, the above 6 solutions are pairwise distinct.