Antibodies are capable of extraordinary variability due to rearrangements of their DNA. Only a small number of changes are needed to come up with a vast array of combinations of amino acids, which are the building blocks of proteins. It's this diversity that means the body can cope with the great number of different viruses out there. Typically, billions of different types of antibodies can be created, although they won't all be in use at any one time.
To understand the source of the variability, we need to consider the structure of the antibody protein molecule. First of all, there are five classes of antibodies - IgG, IgM, IgA, IgD and IgE. Ig stands for immunoglobulin. Each one is a 'Y'- shaped molecule - consisting of four polypeptide chains; two heavy chains and two light chains. The source of the sheer variety of antibody molecules are the highly variable light and heavy chain sections in the left and right arms of the 'Y' shape. It's these parts of the antibody that stick to the target virus or the cell that has been attacked. The virus is removed either by the virus itself or by other white cells that recognise that an antibody has targeted a virus-infected cell for elimination. The trunk of the 'Y' is the constant end and it is attached to a B cell.