randomNumber function

int randomNumber(
  1. int min,
  2. int max
)

Generate random number between min and max

Implementation

int randomNumber(int min, int max) {
  return min + Random().nextInt(max - min);
}