get random string from array list

Solutions on MaxInterview for get random string from array list by the best coders in the world

showing results for - "get random string from array list"
Chiara
27 Feb 2018
1    Random r = new Random();
2
3    int randomitem = r.nextInt(myList.size());
4    String randomElement = myList.get(randomitem);
5