get random string from array list

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

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
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