Density of iron is more than the density of water, weight of iron nail is more than wt. of water displaced by it and nail SINKS. While the shape of the iron ship is made in such a way that it displaces MORE WEIGHT OF WATER than its own weight. Secondly, the ship is HOLLOW and THE EMPTY SPACE contains AIR which makes the AVERAGE DENSITY OF SHIP LESS THAN THAT OF WATER and hence ship floats on water.