title: JAVA writing and loading an Object ArrayList
body: <p>I'm working on a program about students (saving the name, age and other information into objects and storing those objects into an arrayList). So far so good, I even got the JFrames to work exactly how I want them but the problem shows up when I try to write all that information in a text file. </p>
  
  <p>How can I do that?</p>
  
  <p>I tried the FileOutputStream with the ObjectOutputStream but I'm most likely not doing it right since I keep getting an IOException.</p>
  
  <p>An example of a program storing an arrayList with 2 or more Objects containing 2 or more variables each is pretty much what I'm looking for.</p>
  
  <p>As for the loading of that saved array, I think I can figure it out but an explaination on that would still be apreciated.</p>
  
  <p>I've seen a couple of times on different websites people suggesting to do
  (but it gives me an IOException)</p>
  
  <pre><code>    FileOutputStream fos=new FileOutputStream("FileName.txt");
      ObjectOutputStream oos=new ObjectOutputStream(fos);
  
      oos.writeObject(myObjectArrayList);
  </code></pre>