Answer:
Until some other statement puts a different value into it, or until the program ends.
Adding a Number to a Variable
Assume that extra already contains the value 5.
Here is another statement:
value = extra + 2;
The statement will be performed in two steps (as always).
The first step performs the calculation extra + 2extra,
and then adding 2 to it:
The result of the calculation is 7.
The second step puts 7 into the variable value:
QUESTION 15:
What will the following program print out:
// Example assignment statements int extra, value; extra = 5; value = extra + 2; System.out.println( "value now holds: " + value );