- E.g.,
count1 = 3;
count2 = 2;
sum = count2 + count1;
count1 = 4;
In this example, the value ofsum
is 5 because the variablesum
has not been redefined or reassigned. The variablesum
will retain its value of 5 until it is assigned another value.
count1 = 3;
count2 = 2;
sum = count2 + count1;
count1 = 4;
sum
is 5 because the variable sum
has not been redefined or reassigned. The variable sum
will retain its value of 5 until it is assigned another value.