Java - Output 100 integer random number between two int value

Description

Output 100 integer random number between two int value

Demo

import java.util.Random;

public class Main {
  public static void main(String[] args) {
    int a = 0;/*  w  w  w.  ja v a2 s  .  c  om*/
    int b = 37;
    Random rand = new Random();
    for (int i = 0; i < 100; i++) {
      int randomNum = rand.nextInt((b - a) + 1) + a;
      System.out.println(randomNum);
    }

  }
}

Related Exercise