4. If the two roots of the quadratic equation $x^{2}+p x+q=0$ are $p$ and $q$, then $p q$ equals ( ).
(A) 0
(B) 1
(C) 0 or -2
(D) 0 or 1
4. C.

According to the relationship between the roots and coefficients of a quadratic equation, we have
$$
\left\{\begin{array}{l}
p+q=-p, \\
p q=q .
\end{array}\right.
$$

When $q=0$, we have $p=q=0$, so $p q=0$;
When $q \neq 0$, we have $p=1, q=-2$, so $p q=-2$.