Why do you think they shouldn't.
P.S. Take a look at this FAQ for a clarification of terminology and why it is wrong to say something "gains heat": https://www.physicsforums.com/showthread.php?t=511174 [Broken]
Welcome to PF!
Hi AgentPancake! Welcome to PF!
If you put pressure on a fixed volume of gas, won't it heat up?
I think he's talking about heat-expansion and how a body that's not allowed to expand still get hotter.
The trick here is that all objects are at least somewhat compressible. Increasing temperature without allowing to expand is equivalent to heating the object up and then compressing it to original size. (In terms of forces involved.)
Separate names with a comma.