title: JAVA calling a method using a ternary operator
body: <p>I am trying to use ? to decide which method i want to call, but i do not need to assign a variable. My question: Is there a way to use the ternary operator with out assigning a variable?</p>
  
  <pre><code>(something i dont need) = (x == 1)? doThisMethod():doThatMethod()
  </code></pre>
  
  <p>instead of </p>
  
  <pre><code>if(x == 1) {
      doThisMethod()
  } else {
      doThatMethod()
  }
  </code></pre>