- import java.io.*;
- import java.util.Vector;
- public class LoadFromFile {
- try{
- /* Create reader stream to open and read the file. The
- tokenizer stream parses the file into integer
- tokens, ignoring whitespace characters and comma's */
- stream.whitespaceChars(',',','); //can seperate by comma
- int token;
- //this loop loads the arra from the input file
- while((token = streamagain.nextToken()) != streamagain.TT_EOF) {
- switch(token)
- {
- v.addElement(u);
- break;
- default:
- break;
- }
- }//while loop
- } //try
- {
- return;
- }
- {
- return;
- }
- }
- return v;
- }
- }
Raw Paste