We have already seen explicit assignment used when we initialized variables and constants. After we have declared a variable, we can change it by using the =assignment operator. An assignment statement is of the form identifier = value;, whereidentifieris our already-declared variable and the value can be a constant, another variable, the result of a calculation, or the returned value from a function. We will later see how all of these are expressions are evaluated and provide a result.
Here is an example of assignment statements:
feet = 24.75;
The 24.75literal constant is evaluated as a value of float or double type and is assigned to the feetvariable:
feet = yards/3.0 ;
The value of yards is obtained and then divided by the 3.0literal constant. The result of the evaluation is assigned to the feet variable. The value ofyardsis unchanged:
feet = inchesToFeet( inches );
The...