Not quite sure why I'm getting this null pointer exception with this toString method. I've looked at it over and over, and don't see a single thing wrong with it. Maybe someone has a sharper eye than me?
The output I get is the below, so it never gets into the loop, as my print statement's aren't reached:
run:
s = My Grocery Store-[
Exception in
thread "main" java.lang.NullPointerException
at project4.Shop.toString(Shop.java:51)
at java.lang.String.valueOf(String.java:2827)
at java.lang.StringBuilder.append(StringBuilder.java:115)
at project4.Tester.main(Tester.java:17)
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)
Thanks in advance!