Package day7; import Java. util. random; import Java. util. UUID;/*** Java. util. random class * Java. util. UUID class */public class randomdemo {public static void main (string [] ARGs) {/** exercise: generate a pseudo-random number between [0,100) ** construction method: random () creates a new random number generator. * Int nextint () returns the next pseudo-random number, which is the int value uniformly distributed in the sequence of the random number generator * int nextint (int n) returns a pseudo-random number, it is an int value that is evenly distributed between 0 (inclusive) and specified value n (excluded) from the sequence of the random number generator. */random r = new random (); system. out. println (R. nextint (100);/** UUID class: class with a unique identifier (UUID. UUID indicates a 128-bit value. * It can be used as the primary key of the database * Static UUID randomuuid () to obtain the static factory of type 4 (pseudo-randomly generated) UUID. */UUID = UUID. randomuuid (); string u = UUID. tostring (); system. Out. println (U); // 26ce0eec-be3d-rjc-a2f5-f71c9466836d each time }}