boolean yourLoop = true;
//you'll need to import java.util.ArrayList;
ArrayList yourNumber = new ArrayList();
//condition so your loop will run
while (yourLoop){
//get your first number to put in the array list, you need to cast as an int
int randNumber = (int)(Math.random() * 100);
//condition to check if the number is in the array list
if (yourNumber.contains(randNumber)) {
//print out the number that matched
System.out.println(randNumber);
//break the while loop
yourLoop = false;
}
else {
//add the number to your array list
yourNumber.add(randNumber);
//print out the array list
System.out.println(yourNumber);
//get another iteration
yourLoop = true;
}
}