Original Griff already answered your question. Let me improve your overall coding.
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);
while(numFound = false)
{
if (holder == 0)
{
holder = 1;
if (holder!=sum1 && holder!=sum2 && holder!=sum3 && holder!=num1 && holder!=num2 && holder!=num3 && holder!=dum1 && holder!=dum2 && holder!=dum3)
{
numFound = true;
}
} else {
if (holder!=sum1 && holder!=sum2 && holder!=sum3 && holder!=num1 && holder!=num2 && holder!=num3 && holder!=dum1 && holder!=dum2 && holder!=dum3)
{
numFound = true;
}
}
}
How to solve? fix few issues
1. How about instead of declaring each number, declare then as array
2. Move holder generation inside the while loop; so, if the if condition say false it will regenerate the number
3. to check whether number belongs to array, either write a function to check if the array contains your generated number or you can use the following suggestion, described in stackoverflow
java - How can I test if an array contains a certain value? - Stack Overflow[
^]