title: Deserialize Arraylist of objects
body: <p>I am dealing with a utterly painful puzzle I cannot solve... While I have been able to serialize/deserialize single objects I  find myself stuck at the moment. The reason is that I am working with an ArrayList of objects, and cannot figure it out... So far I have managed to write it to a file, FootballClub.ser. This one below is my best attempt, but I get </p>
  
  <p><strong><em>Exception in thread "main" java.lang.ClassCastException: java.util.ArrayList cannot be cast to FootballClubNL</em></strong></p>
  
  <pre><code>public class FootballClubFileWriter {
  
      private static final String filename_1 = "FootballClub.ser";
      private static final String filename_2 = "FootballClub.txt"; //Use for question 5
  
      public static void serializeToDisk(ArrayList&lt;FootballClubNL&gt; clubs) throws IOException {
              FileOutputStream fos = new FileOutputStream(filename_1);
              ObjectOutputStream oos = new ObjectOutputStream(fos);
              oos.writeObject(clubs);
              fos.close();
              oos.close();
      }
  
  
      public static ArrayList&lt;FootballClubNL&gt; deserializeFromDisk()throws IOException, ClassNotFoundException {
  
          ArrayList&lt;FootballClubNL&gt; desrializaedClubs = new ArrayList&lt;FootballClubNL&gt;();
  
          FileInputStream fileIn = new FileInputStream("FootballClub.ser");
          ObjectInputStream in = new ObjectInputStream(fileIn);
  
          FootballClubNL club = (FootballClubNL)in.readObject();
  
          return desrializaedClubs;
      }
  
  }
  </code></pre>