get Random between two integers - Android java.util

Android examples for java.util:Random Integer

Description

get Random between two integers

Demo Code

public class Main{

    private static Long getRandom(int min, int max) {
        return Math.round(Math.random() * (max - min) + min);
    }/*from   www. j  a va 2 s  .  c o  m*/

}

Related Tutorials