First, take the mold operation
Public Static void Main (string[] args) { for (int i = 1; I <=; i++) { int j = i% 11
+ "%11 Results--" +
J); }}/
*
1%11 results--12%11 results--23%11 results--34%11 results--45%11 results--56%11 results--67%11 Results--78%11 Results of the result of 11--910%11 results of--1011%11 results of--012%11--113%11 results--214%11 results--315%11 results--416%11 results--517%11 Results--618%11 Results of%11--820%11 results--9
* /
Second, Java.uitl.Random
Random.nextint (20), arbitrarily fetch the integer between [0,20], where 0 can be taken, and 20 cannot be taken.
Iii. taking any number of a range
Public Static String getrandom (intint max) { new Random (); int s = random.nextint (max)% (Max-min + 1) + min; return string.valueof (s);} /* principle: The range of random numbers to be obtained is [2,100], assuming that the range of pseudo-random numbers returned is [0,n], that is, [0,n-1]; for the obtained modulo 99, the range of the calculated number is [0,98], and the result is added 2, the range is [2,100]. */
Java gets a random number in a range