Thread
:
getting a random result
View Single Post
#
2
(
permalink
)
07-19-2007, 12:42 AM
JavaBean
Moderator
Join Date: May 2007
Posts: 1,272
Lets assume that you put your string inside
str
array. You will implement random selection like this:
Code:
Random rand = new Random(); rand.nextInt(str.length);
Check
javadoc of Random class
for details.
JavaBean
View Public Profile
Send a private message to JavaBean
Find all posts by JavaBean