Java - How Can I Write My ArrayList to a file, and Read (load) that file to the original ArrayList?
I am writing a program in Java which displays a range of afterschool clubs (E.G. Football, Hockey - entered by user). The clubs are added into the following ArrayList : private ArrayList<Club> clubs = new ArrayList<Club>(); By the followng Method: public void addClub(String clubName) { Club club = findClub(clubName); if (club == null) clubs.add(new Club(clubName)); } 'Club' is a class with a constructor - name: public class Club { private String name; public Club(String name) { this.name = name; } //There are more methods in my program but don't affect my query.. } My program is working - it