the problem is the following:
in the line where int [] previousLineArray = new int [(currentLineNumber+1)];
- you create a local array that shadows your member and only visible inside of if
statement. Then when you come to this line: nextLineArray[(nextLineCount)] = (previousLineArray[(nextLineCount-1)
it uses your member array that was not init.