They are both forms of neutron stars, which average around 20km but are the densest objects known to man. Fun fact, one sugar cube of their material would weigh about as much as a mountain (https://imagine.gsfc.nasa.gov/science/objects/neutron_stars1...).
Only in the sense that black holes don't have finite densities.