Its because when you are calling a constructor its creating a new object and assigning the value 0 and as the object goes out of scope its destroyed and so the object in the main does not reflect zero.