aspose file tools
The moose likes Beginning Java and the fly likes genrating Random String Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "genrating Random String" Watch "genrating Random String" New topic
Author

genrating Random String

rai talari
Ranch Hand

Joined: Jan 31, 2006
Posts: 34
hi I want to genrate random string from a String array can u help me regarding this


nothing is impossible in the world even the word impossible sounds as I'M'Possible.
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Yes, I'm sure we can help you -- if you tell us a little more about what you're doing and show us how far you've gotten.


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Chengwei Lee
Ranch Hand

Joined: Apr 02, 2004
Posts: 884
To help you get started, take a look at the API for Math.random() and see how you could use it. What does your String array stores?


SCJP 1.4 * SCWCD 1.4 * SCBCD 1.3 * SCJA 1.0 * TOGAF 8
rai talari
Ranch Hand

Joined: Jan 31, 2006
Posts: 34
thak u for your intrest .
i am validating the userform containing email for that i want to show some protype email addresses of form user@hostname .I am keeping 4 email addresses in string array and i want to randomly generate them to the user.
eagerly waiting for your response
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Originally posted by rai talari:
...I am keeping 4 email addresses in string array and i want to randomly generate them to the user...

So if you already have a String[] of length 4, then all you really need to do is pick a random int from 0 to 3, right?
rai talari
Ranch Hand

Joined: Jan 31, 2006
Posts: 34
thank you
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: genrating Random String
 
Similar Threads
random number
Create string in random order.
ramdom class
WA #1.....word association
XML Http Request issues with IE settings