Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created February 28, 2019 00:45
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/9bbb2fd6ceb91b31b705b4ae4bccd478 to your computer and use it in GitHub Desktop.
Save parzibyte/9bbb2fd6ceb91b31b705b4ae4bccd478 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