This site requires JavaScript, please enable it in your browser!
Greenfoot back
janjan01
janjan01 wrote ...

2011/11/20

Help!array question

janjan01 janjan01

2011/11/20

#
How can I use java.ulti.Scanner to scan a file and store it in a 2D array form? the file content is like: 100 200 300 400 200 300 400 500 300 400 500 600 400 500 600 700 I want to save the above table which is in a txt file (use scanner) into an 2D-array and it may not be always 4X4 table. it may change to 5x5 6x6 or even larger. Thanks!
janjan01 janjan01

2011/11/20

#
I have solved the question but i got a new question how can i get a signal that if the import file by scanner does not exist or the content in the file is not in correct order/format. i do not mean the immediate window will give out warnings but i want a method that will return boolean when the above error occur or not.
You need to login to post a reply.