random number generator from a range for continuos analysis
<p>I can create random numbers from a range using</p>

<pre><code>Random rand = new Random();
int num = rand.nextInt(10);
System.out.println("Generated Random Number between 0 to 10 is : " + num);
</code></pre>

<p>But if i need the next random number generated to be a part of the range <code>minus</code> the already generated one, will keeping the above statement in a loop will suffice?</p>

<p>Also I need to stop once i exhaust all the number from the range.</p>

<p>For eg,</p>

<p>The code gives me a random number between [0-10],</p>

<p><code>1st - 4</code> - range {[0-10]}</p>

<p><code>2nd - 9</code> - range {[0-10]-4}</p>

<p><code>3rd - 8</code> - range {[0-10]-4,9}</p>

<p>..</p>

<p>..</p>

<p><code>10th - 10</code> - range {[0-10]-[0-9]}</p>

<p>Will this function output from [Range]{this is my requirement} or (Range)? Or is there any better alternative solution?</p>
