2. For each $x$, the function $y$ is
$$
y_{1}=2 x, y_{2}=x+2, y_{3}=-2 x+12
$$

the minimum of these three functions. Then the maximum value of the function $y$ is ( ).
(A) 4
(B) 6
(C) $\frac{28}{3}$
(D) $\frac{16}{3}$
2. D.

In the same coordinate system, draw the graphs of $y_{1}$, $y_{2}$, and $y_{3}$, and thus obtain the graph of the function $y$.
It is easy to see that when $x=\frac{10}{3}$, $y$ has a maximum value of $\frac{16}{3}$.