  Two elements in a group $G$ are said to $z$-equivalent or to be in the same
$z$-class if their centralizers are conjugate in $G$. In \cite{kkj}, it was
proved that a non-abelian $p$-group $G$ can have at most $\frac{p^k-1}{p-1} +1$
number of $z$-classes, where $|G/Z(G)|=p^k$. In this note, we characterize the
$p$-groups of conjugate type $(n,1)$ attaining this maximal number. As a
corollary, we characterize $p$-groups having prime order commutator subgroup
and maximal number of $z$-classes.
