hands on one's head:
Public classsuijishu{Private Static Final intN = 200; Private Static Final intLeft = 40; Private Static Final intright = 10000; Private Static Longx0 = 1L; Private LongA = 1103515245L; Private Longc = 12345L; Private Longm = 2147483648L; Private LongRAND (LongR) {R= (R * A + C)% m;//xn+1= (aXn + c) mod m returnR; }Private LongLittle (intAintBLongRand) {returnA + rand% (b-a + 1 ); }Private voidRecursion (intCountLongRand) {if(Count >=N) {return; } Rand=rand (RAND); LongR =Little (left, right, Rand); System.out.print (R+ " "); Recursion (++count, Rand); } Public Static voidMain (string[] args) {Suijishu re=NewSuijishu (); Re.recursion (0, x0); }}
Hands on the brain two:
I find that functions of the same name can be different, which makes the function more comprehensive, and different parameter types can automatically invoke the corresponding function, the overloaded method.
Two or more methods that meet the following conditions form an "overloaded" relationship:
(1) The method name is the same;
(2) The parameter types are different, the number of parameters is different, or the order of the parameter types is different.
Hands-on brain feel