We are given the constraint \( x + y \leq 8 \), with \( x \geq 0 \) and \( y \geq 0 \). To maximize \( Z = 3x - y \), we need to maximize the value of \( x \) while minimizing \( y \).
Since \( x + y = 8 \), the maximum value of \( x \) occurs when \( y = 0 \). Substituting \( y = 0 \) into the equation \( x + y = 8 \), we get:
\[
x = 8.
\]
Thus, the maximum value of \( Z = 3x - y \) occurs at \( x = 8 \) and \( y = 0 \), which gives:
\[
Z = 3(8) - 0 = 24.
\]
Therefore, the maximum value of \( Z \) is 24.