title: Ternary operator's precedence and assignment in Java
body: <p>Why does <code>bar</code> method below fail to compile while <code>foo</code> is fine?</p>
  
  <p><a href="https://i.stack.imgur.com/SE0g6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SE0g6.png" alt="enter image description here"></a></p>