Answer:
The intense gravity from a black hole or a neutron star will pull in dust particles from a surrounding cloud of dust or a nearby star. As the particles speed up and heat up, they emit x-rays. So the x-rays don't come directly from the black hole or neutron star, but from its effect on the dust around it. Although x-rays don't penetrate our atmosphere, astronomers use satellites to observe x-ray sources in the sky.
So, due to intense gravitational pull of the Black holes, even light cannot escape and so, there is no possibility of emitting visible spectrum of light, which can be sensed by human eyes and so, when we discover any black hole through emission of x-rays we find that the black holes will be black only and thus, the name BLACK holes....