title: Switches in Java: Can I include a condition in a case?
body: <p>Here is my code:</p>
  
  <pre><code>switch(age) {
      case 10:
          System.out.println("You are too young to drive.");
          break;
      case 20:
          System.out.println("You can drive!");
          break;
      default:
          System.out.println("Error");
  }
  </code></pre>
  
  <p>What happens if the age is 15? Well, it gives me an error. So I was wondering if it's possible to include a condition within the case. For example,</p>
  
  <pre><code>case (age&gt;=10 &amp;&amp; age&lt;=20):
     System.out.println("You're still too young to drive...");
     break;
  </code></pre>
  
  <p>I could use an if statement, but I'm wondering if this is possible with a switch.</p>