While stretching a rubber sample is the most common example of elasticity, it also occurs when rubber is compressed. Compression may be thought of as a two dimensional expansion as when a balloon is inflated. The molecular mechanisms that produce the elastic force are the same for all types of strain.