The transfer of heat is either convection, conduction or radiation. The first two require some medium. The vaccum of space is the absence of a medium. That leaves radiation. Electromagnetic waves heat an object with their energy.
Since there are no(or in reality very few) particles to heat up in the vaccum of space, it cant heat up.
Latest Answers