title: What is the Java ?: operator called and what does it do?
body: <p>I have been working with Java a couple of years, but up until recently I haven't run across this construct:</p>
  
  <pre><code>int count = isHere ? getHereCount(index) : getAwayCount(index);
  </code></pre>
  
  <p>This is probably a very simple question, but can someone explain it?  How do I read it?  I am pretty sure I know how it works.</p>
  
  <ul>
  <li>if <code>isHere</code> is true, <code>getHereCount()</code> is called, </li>
  <li>if <code>isHere</code> is false <code>getAwayCount()</code> is called.</li>
  </ul>
  
  <p>Correct?  What is this construct called?</p>