Check out example codes for "generate random words from a List java". It will help you in understanding the concepts better.

Code Example 1

// Java program select a random element from array 
import java.util.ArrayList; 
import java.util.List; 
import java.util.Random; 
public class GFG { 
    // Drive Function 
    public static void main(String[] args) 
        // create a list of Integer type 
        List<Integer> list = new ArrayList<>(); 
        // add 5 element in ArrayList 
        GFG obj = new GFG(); 
        // take a random element from list and print them 
    // Function select an element base on index  
    // and return an element 
    public int getRandomElement(List<Integer> list) 
        Random rand = new Random(); 
        return list.get(rand.nextInt(list.size())); 

Learn ReactJs, React Native from