java - Is there an equivalent of x++ that can be used in an expression for incrementing by values greater than 1? -


Apologies for a slightly misleading title.

It is well known that

  int x = 4; Println (x ++); // print 4 x = 4; Println (++ x); // print 5 using   

, I found that

  int x = 4; Println (x + = 4); // print 8   

Will one increase in the above analog X but instead 4 print? Like other assignment operators, the shortcode assignment returns the final value, like

.
This lets you type

  x = y = z + = 4;   

There is no post-shorthand operator that gives original value.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -