A steel needle sinks in water but a steel ship floats. Explain how

An object will float in water if its density is less than that of water. A steel needle sinks since its density is more than water. The interior of a ship is hollow. Therefore, its average density is less than that of water, therefore, it floats.