Java 生成 0 到 60 之间的随机数
import java.util.Random;
public class RandomNumber { public static void main(String[] args) { Random random = new Random(); // 生成一个 0-59 的随机数 int number = random.nextInt(60); System.out.println('随机数:' + number); } }
原文地址: https://www.cveoy.top/t/topic/lh0n 著作权归作者所有。请勿转载和采集!