This approach isn't going to work because each instance will have its own copy of number and nextNumber.

You can either use a static variable that is shared between every instance, or you can pass...