-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NullPointerException when trying to save file to hardrive Level7. #67
Comments
I updated your post to use the triple-back-tick notation for fenced code blocks. See https://docs.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks In think others need to know exactly which statement is causing the NPE i.e., which statement is at |
Have you handled the case where |
|
Could you try printing the |
@wakululuu added the system.out.println(datafile) and in the picture shows i intialise it at the begining |
Sorry for the unclear suggestion previously but maybe print it right before |
doesn't the error |
@zhiayang ah yes my bad that was the problem thank you |
I am attempting Level 7. Save and I am trying to use serialization to save an array which stores my list that is printed out. However my method saveData(ArrayList list) gets the nullPointer error as shown in the image above. I am using intelliJ
Below is my SaveData method (Note not sure why the insert code button isnt working)
The text was updated successfully, but these errors were encountered: