Alright, I've been plugging away at this code for quite some time. I finally felt it necessary to seek assistance in an online forum, as my JAVA mentor is away for the time being.
My idea is to populate a String array, instantiated in the varlib class, with lines from a .txt document. This is the code of my method.
try{ BufferedReader br = new BufferedReader(new FileReader("db/tableA.txt")); for(int i=0; i<varlib.tableA.length; i++) { varlib.tableA[i] = ("" + br.readLine()); System.out.println(varlib.tableA[i]); } }catch(IOException e) { System.err.println(e.getMessage()); }
I'm fairly new at the JAVA thing, but I've been doing some net searching... Not quite sure exactly what I am doing wrong here. Any help would be appreciated!
Blackjack
EDIT: I forgot to tell what it was doing. Basically, the println displays null for every value that there is in the txt file. For example, if the first line was the word Apple, the value of Table[0] is printed as Null