int max = 20;int min = 10;return new Random().nextInt(max-min+1)+min;
生成0-2之间的随机数,包括2Random rand = new Random();int randNum = rand.nextInt(3);生成5-26之间的随机数,包括26int randNum = rand.nextInt(22)+5;