This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Beginning Java and the fly likes [SOLVED]How to randomly get a String from an array in a random amount of times. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "[SOLVED]How to randomly get a String from an array in a random amount of times." Watch "[SOLVED]How to randomly get a String from an array in a random amount of times." New topic
Author

[SOLVED]How to randomly get a String from an array in a random amount of times.

Andrew Sepulveda
Greenhorn

Joined: Oct 02, 2011
Posts: 10
I know how to randomly get a String from an array, but the BIG money question I am asking for today is how to get a random string from an array by a Random amount of cycles, and printing it on the screen.

Here is what I did so far.



I am assuming I would have to use a For loop, which I did try below.



But doing something beyond that is where I am stumped in doing.

My desired output would be:

random String, random String, random String, random String

another ex:

Plates, Silver Coins, Dressing Table, Candy Wrapper, Chipped Bat

Please note that I want all of the randomly picked strings stored in ONE variable.



EDIT: solved it. My idiotic brain did not realize to just add the below code in the for loop.


Andrew Sepulveda
Greenhorn

Joined: Oct 02, 2011
Posts: 10
Sorry for the double post, and the useless thread, but I solved it .
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [SOLVED]How to randomly get a String from an array in a random amount of times.