Step 1: Write the Structure
n-Hexadecyl trimethyl ammonium chloride is \(\left[\text{CH}_3(\text{CH}_2)_{15}\text{N}(\text{CH}_3)_3\right]^{+}\text{Cl}^{-}\).
Step 2: Methyls in the Chain
The straight hexadecyl chain \(\text{C}_{16}\text{H}_{33}\) has only one methyl group, at its far end; the other 15 carbons are \(\text{CH}_2\) groups.
Step 3: Methyls on Nitrogen
The name trimethyl shows three \(\text{CH}_3\) groups attached to nitrogen.
Step 4: Total
\(3 + 1 = 4\) methyl groups.
Final Answer:
The compound contains four methyl groups.
\[ \boxed{\text{(B) }4} \]