Alligators cannot swim in salt water because they lack the glands to excrete salt from their bodies; they can only swim in fresh water. However, they will often hunt near bodies of salt water. In contrast, crocodiles have glands that allow them to filter the salt out of their bodies, so they can easily swim and hunt in bodies of salt water.