the main thread and the summation thread share the object instance of the Sum
class.
This shared object is referenced through the appropriate getSum() and setSum() methods. (You might wonder why we don’t use an Integer object rather than designing a new sum class. The reason is that the Integer class is
immutable—that is, once its value is set, it cannot change.)