Package WZS. arithmetics; // random number public class test {public static void main (string [] ARGs) {int [] test = getrandomintwithout1_plicate (0, 10, 5); // arrays. sort (TEST); For (int I: Test) {system. out. print (I + "") ;}}/*** returns an array of non-repeated random numbers [min, max) * @ Param minimum Random Number * @ Param maximum Random Number * @ Param array length * @ return an array without repeated values */public static int [] getrandomintwithout1_plicate (INT min, int Max, int size) {in T [] result = new int [size]; // array container int arraysize = max-min; // array range: int [] intarray = new int [arraysize]; // initialize the array for (INT I = 0; I <intarray. length; I ++) {intarray [I] = I + min;} // obtain an array that is not repeated for (INT I = 0; I <size; I ++) {int c = getrandomint (Min, Max-I); int Index = C-min; swap (intarray, index, arraysize-1-I ); result [I] = intarray [arraysize-1-I];} return result;}/*** swap Array In the two digit locations * @ Param array * @ Param x * @ Param y */Private Static void swap (INT [] array, int X, int y) {int temp = array [X]; array [x] = array [y]; array [y] = temp;}/*** get a random number int [min, max) * @ Param minimum random value * @ Param maximum random value * @ return random number int */public static int getrandomint (INT min, int max) {int result = min + new double (math. random () * (max-min )). intvalue (); return result;}/*** get a random character * @ Return a random char with the range ASCII 33 (!) To ASCII 126 (~) */Public static char getrandomchar () {// from ASCII code 33 to ASCII code 126 int firstchar = 33 ;//"! & Quot; int lastchar = 126; // & quot ;//"~ "Char result = (char) (getrandomint (firstchar, lastchar + 1); return result ;} /*** get a random length string * @ Param length the length of the string * @ return a string filled with random char */public static string getrandomstring (INT length) {// include ASCII code from 33 to 126 stringbuffer result = new stringbuffer (); For (INT I = 0; I <length; I ++) {result. append (getrandomchar ();} return result. tostring ();}}