If/while statement doesn't execute (java) : <p>I made a <code>public int</code> so that it will return a number different from a number of other integers. It should've returned 9, but, it just gives me a random number like the if statement isn't even there.</p>

<p>Here's the code</p>

<pre><code>import java.util.*;

static int sum1;
static int sum2 = 1;
static int sum3 = 2;
static int num1 = 3;
static int num2 = 4;
static int num3 = 5;
static int dum1 = 6;
static int dum2 = 7;
static int dum3 = 8;


public static int getNumbers()
{
    int holder;
    boolean numFound = false;
    holder = 1 + (int) (Math.random() * 9);

    if (holder == 0) while(numFound = false)
    {
        holder = 1;
        if (holder!=sum1 &amp;&amp; holder!=sum2 &amp;&amp; holder!=sum3 &amp;&amp; holder!=num1 &amp;&amp; holder!=num2 &amp;&amp; holder!=num3 &amp;&amp; holder!=dum1 &amp;&amp; holder!=dum2 &amp;&amp; holder!=dum3)
        {
            numFound = true;
        }
    } else {
        if (holder!=sum1 &amp;&amp; holder!=sum2 &amp;&amp; holder!=sum3 &amp;&amp; holder!=num1 &amp;&amp; holder!=num2 &amp;&amp; holder!=num3 &amp;&amp; holder!=dum1 &amp;&amp; holder!=dum2 &amp;&amp; holder!=dum3)
        {
            numFound = true;
        }
    }
    return holder;
}
public static void main(String[] args) throws InterruptedException {
    sum1 = getNumbers();
    System.out.println(sum1);

}
</code></pre>

<p>What's happening and what can I do to fix it?</p>
