So, you think you’re so clever with your lame old ball-and-socket joints? Beat this, weevils have evolved a sophisticated joint which joins their legs to their bodies with a screw-nut locking device. They have a screw-like ending to the leg end, and a nut-like socket that matches the thread on their screw legs, and it locks in place. This lets them nom away without having to work at keeping their bodies supported (they are totally stable when the legs are locked).
Screws, nuts, beetles. Win.
Source: van de Kamp (2011) A Biological Screw in a Beetle’s Leg. Science. 333, http://www.sciencemag.org/content/333/6038/52.full.pdf.