I have this class and it is working fine for me. It give 5 digit random number. What I can´t achieve is that the 5 numbers be different from each other, I mean no repeat it number in the 5 digit.
import java.util.Random;
public class Test
{
public int[] dedo()
{
Random diceRoller = new Random();
int[] cifra = new int[5];
for (int i = 0; i < cifra.length; i++)
{
int roll = diceRoller.nextInt(9);
cifra[i] = roll;
System.out.print(roll);
}
return cifra;
}
}