Vinetos

Random with min

Sep 5th, 2015
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. private int getRandom(){/*Random entre 5 & 10*/
  2. random = new Random().nextInt(11);//Max
  3. while(random < 5){//Min
  4. random = new Random().nextInt(11);
  5. }
  6. return random;
  7. }
Advertisement
Add Comment
Please, Sign In to add comment