I am getting null-exception throw error in the following code. What can be the reason for it?
public static String[] CreateVocab(BufferedReader buffR) throws IOException{
String[] arr = null;
int i = 0;
arr[i]= null;
String line = new String();
while((line = buffR.readLine()) != null){
arr[i] = line;
i=i+1;
}
return arr;
}
Compiler is showing Null ponter exception in the code
arr[i]=null.