Because density depends upon mass and volume of the object it doesn't depends upon the changing of the shape that why if we change the shape of object the mass and volume of an object remains same
When you change the shape of the object, for example clay into the shape of a boat, you can make it float. This is because the overall ship with the air inside will have less than 1 g/cm3. Smashing the clay into a ball will make the object sink, because the overall density is more than 1 g/cm3.
The density of the clay hadn't changed, but changing the shape can affect how much air is inside the object, making it float.
Steel sinks. Steel battleships float... Because they have air inside.
The density of the clay hadn't changed, but changing the shape can affect how much air is inside the object, making it float.
Steel sinks. Steel battleships float... Because they have air inside.