Something in line 49 of your Memory.java file is null.