Book says " int FoodType::nextId = 20 initializes nextId with 20. Only one instance of static data member nextId exists. order1, order2, and order3 access that same nextId. nextId is incremented in the FoodType's constructor."
order1 is created with the type "Hamburger". id of order1 is set to the current value of nextId, which is 20. nextId is then incremented by 4, making nextId equal to 24. Creation of order2 order2 is created with the type "Salad". id of order2 is set to the current value of nextId, which is now 24. nextId is incremented by 4 again, making nextId equal to 28. Creation of order3 order3 is created with the type "Muffins". id of order3 is set to the current value of nextId, which is now 28. nextId is incremented by 4 once more, making nextId equal to 32. Printing order3 The Print method is called on order3. It outputs id and type of order3, which are 28 and "Muffins" respectively.