Ranges in Java, what's the best approach?
<p>Okay, let's say an integer A should have the range of:
[0...2147483647]</p>

<p>So basically, the pseudo code goes like this:
if integer A is within that range do something...
else do something else.</p>

<p>I know it can be accomplished by a simple if..else statement,
but is there a more efficient way to check if A is within the range? </p>

<p>I don't want to go with this because it seems so wrong:</p>

<pre><code>if (A&gt;=0 &amp;&amp; A&lt;=2147483647){
//do something
}else{ //do something else}
</code></pre>

<p>edit: I think I'm asking the wrong question so I'm just gonna ask, how to do this using the polymorphic approach. I just need some simple illustration because the book that I've been reading has a really long example. >_&lt; Sorry.</p>
