When two object occupy the same space or have the same volume, but one of them is heavier than the other. This means that the heavier object is having a higher mass which results in a higher density than the other (lighter) object.
Note that density is calculated using the following rule:
density = mass / volume