1 List<Integer> list = new ArrayList<>(); 2 Random random = new Random(); 3 int n = random.nextInt(list.size()); 4 list.get(n);
原文地址:https://www.cnblogs.com/wang-yaz/p/8574702.html
时间: 2024-10-12 01:48:32
1 List<Integer> list = new ArrayList<>(); 2 Random random = new Random(); 3 int n = random.nextInt(list.size()); 4 list.get(n);
原文地址:https://www.cnblogs.com/wang-yaz/p/8574702.html