If z=3+4i, find z^{2}. i^{2}=(-1)

I don't get this question. How can the "i" squared =(-1)?

(3 + 4i)^2 = (3 + 4i)(3 + 4i) = 9 + 24i - 16i^2 = 9 + 24i + 16 = 25 + 24i.

"i" is the, so-called, imaginary number, defined such that i^2 = -1; and z is known as a complex number.

(3+4i)^2 = 3^2 +2*3*4i + (4i)^2 = 9 + 24i + 16*i^2 = 9 + 24i + 16*(-1) = 9 + 24i - 16 = -7 + 24i