如何用1递增顺序生成1000到9999之间的数字?用一个递增顺序生成数字,范围在
我试着用随机类,它工作正常,但不生成随机数,我想要在范围内生成数字。
private int RandomNumber(int min, int max)
{
Random random = new Random();
return random.Next(min, max);
}
然后我把这个方法:
int returnValue = RandomNumber(5, 20);
试一试这可能是有用的http://stackoverflow.com/questions/363681/generating-random-number-in-a-range-with-java –