The technical term for the whistling that can occur with hearing aids is "acoustic feedback." Acoustic feedback in hearing aids occurs when amplified sound exiting the hearing aid from the speaker gets picked up again by the microphone. It sounds like a squeal or whistle, and it can be quite embarrassing and annoying for wearers as well as those around them.
Almost all hearing aids will create feedback when something is placed next to the microphone – for example, when wearers cup their hands over their hearing aids, they will usually whistle. Hearing aids should not feed back during ordinary wear when there is nothing near the microphone. Some typical causes of feedback include loose-fitting hearing aids (this allows sound to leak out and feed back into the microphone), hearing aids that are not seated properly in the ear, and blockage in the ear such as earwax.
Today, many digital hearing aids have special systems that help to reduce feedback. These systems detect the feedback and eliminate it before it is audible to the wearer. If your hearing aids are whistling, visit the professional at your local hearing aid center to determine what is causing it and how it can be fixed.