Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void fillArrays() throws IOException{
- String temp;
- String[] files = {KBowlCats.ARTS, KBowlCats.CAPITALS, KBowlCats.ENGLISH, KBowlCats.GEOGRAPHY, KBowlCats.GLOBAL_TECH, KBowlCats.GOVERNMENT, KBowlCats.HEALTH, KBowlCats.HISTORY, KBowlCats.ITF, KBowlCats.LITERATURE, KBowlCats.MATH, KBowlCats.OHIO_HISTORY, KBowlCats.OUR_US, KBowlCats.POTPURRI, KBowlCats.SAFETY, KBowlCats.SCIENCE, KBowlCats.SPELLING, KBowlCats.SPORTS, KBowlCats.VIP, KBowlCats.WORK_LEADERSHIP}; //This array holds strings that contain file locations.
- String[][] arrays = {KBowlCats.arts, KBowlCats.capitals, KBowlCats.english, KBowlCats.geography, KBowlCats.globalTech, KBowlCats.government, KBowlCats.health, KBowlCats.history, KBowlCats.itf, KBowlCats.literature, KBowlCats.math, KBowlCats.ohioHistory, KBowlCats.ourUS, KBowlCats.potpurri, KBowlCats.safety, KBowlCats.science, KBowlCats.spelling, KBowlCats.sports, KBowlCats.vip, KBowlCats.workLeadership}; //This array holds arrays to keep all the lines of text from the files.
- for(int x = 0; x < files.length; x++){
- try {
- BufferedReader br = new BufferedReader(new FileReader(files[x]));
- for(int i = 0; i < 200 && (temp = br.readLine()) != null; i++){
- arrays[x][i] = temp;
- }
- } catch (FileNotFoundException e) {
- System.err.println("Error:" + e);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement