For some reason.... I'm getting a null pointer exception..... while adding elements to an arraylist. I'm not even sure how that can happen...
here's the code snippet ``` public void hash(Scanner scan){ ArrayList resList = null; ArrayList nameList = null; String[] stringsForArray = getArray(scan); for (String newElement : stringsForArray) { if(isReserved(newElement)){ resList.add(newElement); } else{ nameList.add(newElement); } } hashReserved(resList,scan); hashName(nameList, scan); } ``` Here's where the issue is ``` nameList.add(newElement);
Join our real-time social learning platform and learn together with your friends!