Hoopoes have long, thin, downward-curving beaks perfectly adapted for catching insects. They probe into crevices and holes in trees and walls, dig out hidden insects, and can impale prey on the tip of the beak. They also catch flying insects by sallying from a perch. The beak is also used for nest building and self-defense.