They are able to absorb what they need from the water through their skins. In California, only rattlesnakes are dangerously venomous. Be aware, however, that this is very general. Some nonvenomous snakes, notably Gopher Snakes, will vibrate their tails, flatten their heads, and hiss and strike in an effort to frighten perceived enemies. If you are unsure, or aren't close enough to clearly see the features, leave it alone.
Many bites occur to people who are trying to capture or kill the snake.
Also be aware that these characteristics don't apply outside of California. And Coral Snakes are thin, have tapering tails, and little distinction between the head and body. Of course, venomous snakes in other parts of the world have other characteristics, and you can't tell by just looking at them whether they are venomous or not. Get a good field guide with color pictures and descriptions of the snakes you are likely to see in an area you plan to explore, and use common sense and good precautions when you are in the field. See also our Venomous Reptiles page.