Why does a ship float in water while a needle sink in water?
A ship can float not because of density, but because of the amount of water it "pushes" aside to make the ship feel like a normal styrofoam. It displaces the water to some other further areas. It’s also caused by air in the ship, causing a reaction between earth’s gravity and the force of the water, pushing the boat upwards. Mainly it is also of the shape of the entire ship. It is designed to be like that. Same goes for swimming.
Density. Anything less dense than water (density = 1) will float on water. Anything more dense than water will sink. It’s interesting that when water freezes, it actually becomes less dense. That’s why ice floats in water. The most dense liquid is mercury. You can float a brick in a puddle of mercury.