public static <T> T getRandomList(List<T> list) { Random random = new Random(); int index = random.nextInt(list.size()); return list.get(index); }
JAVA List随机获取任一对象
最新推荐文章于 2024-07-31 04:28:28 发布
public static <T> T getRandomList(List<T> list) { Random random = new Random(); int index = random.nextInt(list.size()); return list.get(index); }