title: Java - switch case, Multiple cases call the same function
body: <p>Since I have multiple <code>String</code> cases which should be handled the same way, I tried:</p>
  
  <pre><code>switch(str) {
  // compiler error
  case "apple", "orange", "pieapple":
    handleFruit();
    break;
  }
  </code></pre>
  
  <p>But I get a compiler error. </p>
  
  <p>Should I have to, in Java, call the same function case by case:</p>
  
  <pre><code>switch(str) {
    case "apple":
        handleFruit();
         break;
    // repeat above thing for each fruit
    ...
  }
  </code></pre>
  
  <p>Is there no simpler style?</p>