String Array = NullPointerException
I am trying to fill an array of strings. However, I keep getting NULLPOINTEREXCEPTION. I cannot for the life of me figure out why. If anyone could help, it'd be a lifesaver.
This is the part of my code thats problematic-
String[] array = null;
array = spelling.split(" ");
String wrong = "";
String[] aArray = null;
BufferedReader areader = new BufferedReader(new FileReader("Dictionary 'A'.txt"));
for(int p = 0; p < areaderline; p++){
String atemp = areader.readLine();
aArray[p] = atemp;--------NullPointerException here
}
areader.close();