Such an object is called a black hole. That is, just like we need to throw something faster than 11.2 km/s to make it leave the Earth's surface, objects need to travel faster than 300,000 km/s to escape a black hole. And, because nothing can travel faster than 300,000 km/s, nothing can escape a black hole's surface.