Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created August 20, 2020 03:30
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 parzibyte/296091fce572d35d47d3f58eeb19aa0b to your computer and use it in GitHub Desktop.
Save parzibyte/296091fce572d35d47d3f58eeb19aa0b to your computer and use it in GitHub Desktop.
public static int getRandomNumber(int min, int max) {
// nextInt regresa en rango pero con límite superior exclusivo, por eso sumamos 1
return ThreadLocalRandom.current().nextInt(min, max + 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment