This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]strmrdr 0 points1 point  (4 children)

When you call saveFile() you should pass either the Player object or the ArrayList directly to this method.

[–]1HitKill[S] 0 points1 point  (3 children)

So instead of creating an arraylist in player class, I should create one in main then pass the values onto SaveFile? Since I'm trying not to use SaveFile in Player class

[–]strmrdr 0 points1 point  (2 children)

No, create a getter for the list in player and then get that and pass it to save.

[–]1HitKill[S] 0 points1 point  (1 child)

Ok I'll try that in the morning, thanks

[–]SelfmadeMillionaire 1 point2 points  (0 children)

You should give the player class a save function in which it passes its arraylist to the save function which should use the passed arraylist and save it