1ArrayList<Type> arraylistName = new ArrayList<>();
2
3// add items to arraylist
4arraylistName.add(item1);
5arraylistName.add(item2);
6arraylistName.add(item3);
7
8Random random = new Random();
9// random index between 0 and arraylistName.size();
10int randomIndex = random.nextInt(arraylistName.size());
11
12System.out.println(arraylistName.get(randomIndex));