The mechanism by which B cells can change the type of antibody (i.e. isotype) that is produced during the course of an immune response. Early in a response, mature B cells express the immunoglobulins IgM and IgD, but later on can switch to IgG, IgA, or IgE antibodies. This switch is achieved by recombination between stretches of DNA among the genes encoding the constant regions of the immunoglobulin heavy chains, which determine isotype.