title: Is it possible to have multiple potential values for a variable in java
body: <p>This is a portion of my code, I'd like a variable be assigned a certain rate depending on the different custid number. I'm seeing a duplicate local variable error, is there anyway to get around this?</p>
  
  <pre><code>if(custid&lt;=100 &amp;&amp; custid&gt;=1) {
          double disc = .15;
      }
      else if(custid&lt;=250 &amp;&amp; custid&gt;=101) {
          double disc = .18;
      }
      else if(custid&lt;=500 &amp;&amp; custid&gt;=251) {
          double disc = .23;
      }
      else if(custid&lt;=1000 &amp;&amp; custid&gt;=501) {
          double disc = .28;
      } 
      else if(custid&gt;=1001) {
          double disc = .32;
      } 
  
      if(bill&gt;=1000) {
          System.out.println(bill*disc);
      }
  </code></pre>