Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Computer Forums > Programmers Lounge > Programming Discussions » Java and Importing arrays.
Closed Thread
Old 02-02-2006, 01:52 PM   #1 (permalink)
 
Ultra Techie

Join Date: Jan 2003

Posts: 584

mrdinkel

Default Java and Importing arrays.

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"};
__________________
A+ Core Hardware, Software Certified (May 13 2005)
the new beast...

AMD Athlon XP 3200+ Barton running at 2.16 Ghz.
GeForce MX 4000 (mainly takes the load off the main system)
Creative Labs Audigy 24-bit sound.
Some Case from tigerdirect
512 MB Ultra DDR RAM.
80GB Seagate HDD
LiteOn CD-RW / DVD ROM drive.
currently looking at a litescribe drive at staples, due to its ability to label the CD shortly after being burned.
mrdinkel is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On