Short answer, it's a solid hunk of rock.
Stars are not. Stars are a mass of incandescent gasses; a gigantic nuclear furnace where hydrogen is smelt into helium at a temperature of millions of degrees.
Gaseous planets and stars will collapse into something solid (or explode). Not all stars collapse to explode though. They have to be 1.4 times the size of our Sun to do that. https://en.wikipedia.org/wiki/Chandrasekhar_limit