Random、随机颜色、UUID、全球唯一,随机字符串
package wzt;
import java.awt.*;
import java.util.Random;
import java.util.UUID;
public class Rand1 {
public static void main(String[] args) {
System.out.println(Math.PI);
//Manth.random()返回0-1之间的随机小数
System.out.println(Math.random());
System.out.println(Math.random());
System.out.println(Math.random());
var rand=new Random();
System.out.println(rand.nextBoolean());
System.out.println(rand.nextBoolean());
共有 0 条评论