Your calculate class creates a customer of its own. It does not matter, if you create another customer, with identical values in your main method. That IS NOT the same customer instance. You should have the calculations as a method in your calculate class, where the customer is given as a parameter. That way the right customers money would change.