i need an array contains 10 elements with no repeating integers.. so my question is how to make an if condition to check everytime if the next random value is in the array or not.. i need a simple code i'm just a beginner here is my code
public static void main(String[] args) {
int []a = new int [10];
for (int i =0 ; i< 10 ; i++)
{
a[i]= (int)(Math.random()*100)+1;
System.out.println(a[i]);
}
}