Skip to content

Instantly share code, notes, and snippets.

@gotoark
Last active November 12, 2016 12:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gotoark/c00d26b292c826866ab8ad4e725274c1 to your computer and use it in GitHub Desktop.
Save gotoark/c00d26b292c826866ab8ad4e725274c1 to your computer and use it in GitHub Desktop.
Create Random Number With in The Range min-max(both values inclusive)
//Generate Random Numbers
final int min = 0;
final int max = 9;
Random g=new Random();
final int random = g.nextInt((max - min) + 1) + min; //Random number 0(inclusive)-9(inclusive)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment