Example 2 In octal, a perfect square is $(a b c)_{8},(a \neq 0)$, find $c$.

Translate the above text into English, keep the original text's line breaks and format, and output the translation result directly.
Solution: Let $n^{2}=(a b c)_{2}, n \in Z^{+}$, and classify $n$ by modulo 4.
When $n=4 k\left(k \in Z^{+}\right)$, $n^{2}=16 k^{2}, 8 \mid n^{2}$, then $c=0$, and $\frac{n^{2}}{8}=2 k^{2}$ is even; but $\frac{n^{2}}{8}=(a b c)_{8}$ is odd, which is a contradiction.

When $n=4 k+2(k \geqslant 0, k \in Z)$, $n^{2}=8\left(2 k^{2}+2 k\right)+4$, at this time $c=4$, thus $n^{2}-4=8 \times 2 k(k+1)$, then the second digit from the right in the octal representation of $n^{2}-4$ should be even, but 3 is odd, which is a contradiction.
Therefore, $n$ must be odd, and the square of an odd number modulo 8 is 1, so $c=1$.