WhiteShadow
03-02-2011, 07:48 PM
Hey,
Does anyone know a way to make a 'global' scanner & filereader?
I'm trying to make a program that reads a file and uses the input to do stuff but the problem is different parts of the program need different parts of the file so I want to be able to use scanner.next() in one part of the program and then skip a couple lines and have the other part of the file use the nextInt() or something. You know like not just restricted to one main loop or anything.
And I'm not allowed to parse everything at once and save it in a ArrayList<String> or anything. :(
Thanks,
WhiteShadow
Does anyone know a way to make a 'global' scanner & filereader?
I'm trying to make a program that reads a file and uses the input to do stuff but the problem is different parts of the program need different parts of the file so I want to be able to use scanner.next() in one part of the program and then skip a couple lines and have the other part of the file use the nextInt() or something. You know like not just restricted to one main loop or anything.
And I'm not allowed to parse everything at once and save it in a ArrayList<String> or anything. :(
Thanks,
WhiteShadow