Java - Write code to get Random between two integer values

Requirements

Write code to get Random between two integer values

Demo

//package com.book2s;

public class Main {
    public static Integer getRandom(Integer min, Integer max) {
        return (int) (Math.random() * (max - min) + min);
    }/*from w w  w  .j a v  a2s  .c o m*/
}

Related Exercise