java 从List中随机取出一个元素
1 List<Integer> list = new ArrayList<>(); 2 Random random = new Random(); 3 int n = random.nextInt(list.size()); 4 list.get(n);