In $\triangle ABC$, $\angle C = 90^\circ$, $AC = 3$ units, and $BC = 4$ units. If $\angle B = \theta$, find $\sin \theta$ and $\cos \theta$. Then, calculate the length of the hypotenuse $AB$. Let's think step by step and output the final answer within \boxed{}.
user