2. In the range of real numbers, let
$$
\begin{array}{c}
M=[\sqrt{(a+1)(|a|-2)}+\sqrt{(a+1)(2-|a|)}+ \\
\sqrt{(a-1)(|a|+2)}]^{2005} .
\end{array}
$$

Then the unit digit of $M$ is ( ).
(A) 2
(B) 3
(C) 5
(D) 1
2. A.

From the problem, we have
$$
\left\{\begin{array}{l}
(a+1)(|a|-2) \geqslant 0, \\
(a+1)(2-|a|) \geqslant 0 .
\end{array}\right.
$$

Therefore, $(a+1)(|a|-2)=0$.
Solving this, we get $a=-1$ or $a= \pm 2$.
Since $a=-1$ or $a=-2$ do not satisfy the conditions, we have $a=2$.
At this point, $M=2^{2005}=2 \times 2^{4 \times 501}=2 \times 16^{501}$.
Since the units digit of $16^{501}$ is 6, the units digit of $M$ is 2.