2.6 assignment statements and assignment expressions

Important Note: assignment statement will specify a value to a variable. Assignment statement in Java can be used as an expression.

  • expression

  It represents the value relates to, and a variable arithmetic operators, which together compute a new value.

note:

  In mathematical operation, x = x * 2 + 1 represented by an equation, but in Java x = x * 2 + 1, is an assignment, it computes x * 2 + 1, and the result is assigned to x.

Guess you like

Origin www.cnblogs.com/cglib/p/11945078.html