  The recent precise measurement of the mass of pulsar PSR J1614$-$2230, as
well as observational indications of even more massive neutron stars, has
revived the question of the composition of matter at the high densities
prevailing inside neutron-star cores. We study the impact on the maximum
possible neutron-star mass of an "exotic" core consisting of non-nucleonic
matter. For this purpose, we study the occurrence of a first-order phase
transition in nucleonic matter. Given the current lack of knowledge of
non-nucleonic matter, we consider the stiffest possible equation of state
subject only to the constraints of causality and thermodynamic stability. The
case of a hadron-quark phase transition is discussed separately. The purely
nucleonic matter is described using a set of unified equations of state that
have been recently developed to permit a consistent treatment of both
homogeneous and inhomogeneous phases. We then compute the mass-radius relation
of cold nonaccreting neutron stars with and without exotic cores from the
Tolman-Oppenheimer-Volkoff equations. We find that even if there is a
significant softening of the equation of state associated with the actual
transition to an exotic phase, there can still be a stiffening at higher
densities closer to the center of the star that is sufficient to increase the
maximum possible mass. However with quarks the maximum neutron-star mass is
always reduced by assuming that the sound speed is limited by $c/\sqrt{3}$ as
suggested by QCD calculations. In particular, by invoking such a phase
transition, it becomes possible to support PSR J1614$-$2230 with a nucleonic
equation of state that is soft enough to be compatible with the kaon and pion
production in heavy-ion collisions.
