Ask your own question, for FREE!
Mathematics 9 Online
OpenStudy (hyroko):

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...

OpenStudy (hyroko):

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); } ```

OpenStudy (hyroko):

``` nameList.add(newElement); //here is where I'm getting the error. ```

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Arriyanalol: i need help
1 day ago 7 Replies 1 Medal
Arriyanalol: CONGRATS to me
1 day ago 8 Replies 2 Medals
Legomaster346: What colleges are good that are near Arab Alabama?
1 week ago 5 Replies 0 Medals
Arriyanalol: i need help
1 week ago 6 Replies 2 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!