Skip to content

Instantly share code, notes, and snippets.

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