A good answer might be:x: 98 y: 98 | ||||||||||||||||||||||||
More Assignment OperatorsThe operators +, -, *, /, (and others) can be can be used with = to make a combined operator For example, The following adds 5 to sum: This statement has the same effect as:sum += 5; // add 5 to sum Here is a shortened list of these combined operators:sum = sum + 5; // add 5 to sum
When these operators work, the complete expression on the right of the "=" is evaluated before the operation that is part of the "=" is performed. Here is a program fragment: double w = 12.5 ; double x = 3.0; w *= x-1 ; x -= 1 + 1; System.out.println( " w is " + w + " x is " + x ); | ||||||||||||||||||||||||
QUESTION 9:What does this program fragment write out? Click Here after you have answered the question |