0

So hello everyone! This is my school project but I'm having a problem in my code. So here is the program i want to create. I want to create a program that can generate 5 numbers from 1-9 then user will guess it. My problem only is on the generating some unique numbers. My point in generating numbers are like there shouldn't be have a same number in generating it. EG.:"1 ,5 ,3 ,2, 6" this is correct while E.G:"2, 5, 4, 3, 2" is **wrong**. So i already have a code. please help me to fix/build it! Thanks alot.

```
import java.util.ArrayList;
import java.util.Arrays;
ArrayList<Integer> numbers = new ArrayList<Integer>();
for( a = 0; a < 9; a++)
{
numbers.add(a+1);
}
Collections.shuffle(numbers);
number1= numbers.get(0) ;
number2= numbers.get(1);
number3= numbers.get(2);
number4= numbers.get(3);
number5= numbers.get(4);
```

Please help me. THANKS