Objects comprised of material that is denser than water tend to sink; objects with a lighter density tend to float. Since air is lighter than water, hollow objects can float if their total density is less than water. Preventing objects from absorbing water is important.
Liquids have different densities, and objects will sink if they are of a greater density than the substance they are placed in; dense objects, including rocks and pieces of metal, will sink if placed in water. Lighter objects, including most types of wood, will float.
Dense material can be made to float if it contains enough air, which has a density much lower than that of water. A metal ball that is hollowed out and appropriately sealed can have a density less than water, which will cause it to float. Heavier metals need more air, but any material can be made to float.
Boats float by taking advantage of this principle, and they can be made of woods that are denser than water. The large hull of a boat holds a significant amount of air, which lowers its total density. If the boat is loaded too heavily or if water enters the hull, the boat can sink if its density gets too high.