Which is better exercise: swimming or walking?

Neither is better. Just different. Swimming is more of a total body workout and easier on the joints. While running is higher impact and better for stimulating maintained or increased bone density.