It is rather a wrong statement.
If we consider an object.,
Changing the shape of an object will not change the density of an object because the mass and the volume stays the same. So then the density stays the same.
Here we take the example of water.
Water can be taken in different vessels.Water takes the shape of the vessel.But density of water remains the same in each vessel irrespective of shape.
Considering a single object.
If we increase the size of an object the mass and volume of the object increase proportionally.
Therefore density remains same.
The important thing to be in mind is density is mass per unit volume of the substance.