title: operators ? and : with boolean and void
body: <p>I am trying to figure out how to use operators ? : instead if else block</p>
  
  <p>My case is below:</p>
  
  <pre><code>if (boolean variable) {
  void1(); }
  else {
  void2();
  }
  </code></pre>
  
  <p>is it possible to do this by that way:</p>
  
  <pre><code>boolean variable ? void1() : void2();
  </code></pre>
  
  <p>I was looking for an answer but I cannot find it with boolean and call void method</p>