View Single Post
  #4 (permalink)  
Old 04-07-2008, 08:02 PM
DonCash's Avatar
DonCash DonCash is offline
Moderator
 
Join Date: Aug 2007
Location: London, UK
Posts: 240
DonCash will become famous soon enoughDonCash will become famous soon enough
Hello JavaShak. Thanks for your input. In future - Please put the [code] [/ code] tags (minus the space after /) around your code. This makes it alot easier for people to read.

Hey Szimme101, take a look at this code below. This is exactly what you need to make it work:

Code:
FileInputStream in = new FileInputStream("yourfile.txt"); BufferedReader br = new BufferedReader(new InputStreamReader(in)); String[] myarray; myarray = new String[9]; for (int i = 0; i < myarray.length; i++){ myarray[i] = br.readLine(); } in.close();
You can print out all the array values by using this:

Code:
for (int a = 0; a < myarray.length; a++){ System.out.println(myarray[a]); }
__________________
Did this post help you? Please
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
me!

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by DonCash : 04-07-2008 at 08:04 PM.
Reply With Quote