The iron ship is constructed in such a way that it is mostly hollow from within Hence the average density of the ship is less than that of water (i.e. less than 1 g/cm3 ) wheres iron needle being compact and its density is 7.6g/cm3 which is more than 1 g/cm3 (density of water) Hence the needle sinks in water.