Java tutorial
//package com.java2s; import java.util.Random; public class Main { /** * @param min * @param max * @return */ public static String getYZM(final int min, final int max) { Random random = new Random(); int randomnum = 0; int tmp = Math.abs(random.nextInt()); randomnum = tmp % (max - min + 1) + min; return randomnum + ""; } }