Can non-isomorphic abelian groups have isomorphic endomorphism rings?

I am aware that distinct Banach spaces $X$, $Y$, give rise to distinct operator algebras $B(X)$, $B(Y)$, but the proof seems to rely heavily on the use of projections and the Hahn-Banach theorem. So if there is a generalization to rings and groups, it is not obvious.

• If there are no easy examples, I am worried the answer may be independent of ZF; specifically I am worried about weird examples like $\mathbb{Z}^X$ for $X$ a weird set in some nonstandard model of ZF. There is precedent for such things happening in the theory of abelian groups (see e.g. en.wikipedia.org/wiki/Whitehead_problem). – Qiaochu Yuan Jun 27 '13 at 8:07

Yes, both $\mathbb{Z}$ and $\{ \frac{a}{b} \in \mathbb{Q} : b \text{ is square-free} \}$ have endomorphism ring $\mathbb{Z}$. If $A \leq \mathbb{Q}$, then its endomorphism ring is a subring of $\mathbb{Q}$, and such subrings are easily classified by which primes of $\mathbb{Z}$ are invertible. None are in either endomorphism ring, so they are both $\mathbb{Z}$.