Mass of a compressed spring I was wondering if:


*

*The mass of a compressed spring is greater than that of an uncompressed spring 

*The mass of a body on the surface of the Moon is greater than that on Earth


according to the equation $E= mc^2$
 A: 1) Yes. When you compress a spring you do work on it, adding energy to it. This energy is stored in the configuration of the molecules that make up the spring. As you rightly point out, the $E=mc^2$ relation for an object at rest can then lead us to conclude that the rest mass of a compressed spring exceeds the rest mass of an uncompressed spring. But you should do the calculation to determine by how much!
2) Yes, but... When considering the energy of a bound gravitational system, it is best to think of the system as a whole. Consider the following thought experiment: You begin with a ball held at some height above the surface of the earth. Let's say that the rest mass of the elevated ball + earth system is $m_1$. Then you allow the ball to drop to the surface of the earth. When it hits the ground, some energy is released as sound, thermal vibrations, and eventually thermal radiation. Some of this energy will escape into space. Again, because of the $E = mc^2$ relation for objects at rest, the rest energy of the dropped ball + earth system, $m_2$, will be less than $m_1$. 
In reality, the situation is further complicated by accounting for the energy it took to lift the ball in the first place and including that in the energy budget (which, ultimately, would lead you to consider the radiative energy from the sun that the earth is constantly absorbing and reradiating). If it helps, you can simplify the thought experiment by imagining the ball starting at rest in space and falling to earth as a meteor.
More caveats for those with some knowledge of general relativity: one must always consider the reference frame in which energy measurements are made. All of the discussion to #2 so far has implicitly been making use of an observer at rest with respect to the earth and located sufficiently far away from the earth such that the observer is no longer measurably affected by its gravitational field. If you're interested in, say, the mass of an individual electron in the ball in the example above, then the equivalence principle tells us that we can always transform this coordinate system to a local inertial frame centered at the position of the electron. In this local frame, the electron's rest mass will still be the good old 9.11e-31 kg regardless of the position of the ball, even though in the frame of the original observer at rest at infinity, the combined rest mass of the system changes after the ball is dropped and some energy escapes. For a related discussion, see this question of mine.
