Java and Importing arrays.

Status
Not open for further replies.

mrdinkel

Daemon Poster
Messages
584
To those in the know, is there any way to import an array from a text file in Java? I'm kind of at a loss at whether or not to copy / paste/format an array of over 1000 items or find a way to do it from a text / csv file.

I looked at the google results on the web, and it just didn't make any sense to me.

What I am trying to do is a random excuse generator, like Simon Travaglia did, but do it in Java.

the random number generator worked, but i couldn't figure out how to set the range of the random number generator.

This is what I have right now... and it just seems to be horribly inefficient.

String[] bla = {"clock speed","solar flares","electromagnetic radiation from satellite debris","static from nylon underwear","static from plastic slide rules","global warming","poor power conditioning","static buildup","doppler effect","hardware stress fractures","magnetic interference from money/credit cards","dry joints on cable plug","we're waiting for [the phone company] to fix that line","sounds like a Windows problem, try calling Microsoft support","temporary routing anomaly","somebody was calculating pi on the server","fat electrons in the lines","excess surge protection","floating point processor overflow","divide-by-zero error","POSIX compliance problem","monitor resolution too high","improperly oriented keyboard"
,"network packets travelling uphill (use a carrier pigeon)","Decreasing electron flux","first Saturday after first full moon in Winter","radiosity depletion","CPU radiator broken","It works the way the Wang did, what's the problem","positron router malfunction","cellular telephone interference"};
 
Status
Not open for further replies.
Back
Top Bottom