title: Ternary operator not working in Android
body: <p>I have a simple question that boggles me. I am trying to use the ternary operator in java. I am new to Android and java. This code gives me the error:</p>
  
  <pre><code>amt &lt; 0 ? lendBtn.setChecked(true) : lendBtn.setChecked(false);
  
  "Syntax error on token "&lt;", invalid AssignmentOperator"
  </code></pre>
  
  <p>So, I replace it with an if statement and it totally works:</p>
  
  <pre><code>if (amt &lt; 0) { ... }
  </code></pre>
  
  <p>It's not a big deal but does anyone know why?</p>