So i will get a random number between 1 to 9999
but i want to excluding 1111 ,3333,4444,7777 and is that use while loop?
Random r = new Random(); int x = r.nextInt(9999); while (x == 1111 || x==3333) { x = r.nextInt(9999) + 1; }
Aucun commentaire:
Enregistrer un commentaire