Android examples for java.util:Random
choose At Random
//package com.java2s; import java.util.List; import java.util.Random; public class Main { public static final Random RANDOM = new Random(); public static <T> T chooseAtRandom(List<T> list) { return list.get(RANDOM.nextInt(list.size())); }//from w w w. ja v a 2s . co m }