Using static variables in programs

Please take a look at this shortened version of the real app. I built this program just to follow and solve the issue in a simpler way. How to use a static variable. well, of course, my purpose is to prevent various objects to have a copy of that.