title: My class is Serializable and i have java.io.NotSerializableException why?
body: <p>I have this exception and I don't understand why. The error log :</p>
  
  <pre><code>java.io.NotSerializableException: java.io.ObjectOutputStream
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
      at handballapp.HandballApp.main(HandballApp.java:62)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
      at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
  </code></pre>
  
  <p>The main class, the problem seems to be here at <strong>out.writeObject(out);</strong> so i suppose it's a output format problem or something like that : </p>
  
  <pre><code>public class HandballApp extends Application{
     public static void main(String[] args) {
  
      ArrayList&lt;Equipe&gt; str = new ArrayList&lt;&gt;();
  
      str.add(new Equipe("Paris-SG", "D1", 1, 22, 11, 11, 0, 0, 378, 301, "Raul Gonzalez Gutierrez", "Jesus Gonzalez Fernandez"));
  
      File f = new File("team.txt");
      try {
          FileOutputStream fos = new FileOutputStream(f);
          ObjectOutputStream out = new ObjectOutputStream(fos);
              out.writeObject(out);
              out.close();
              fos.close();
  
          System.out.println("Data write successfully !");           
  
      } catch (FileNotFoundException ex) {
          ex.printStackTrace();
      } catch (IOException ex) {
          ex.printStackTrace();
      }
  }    
  }
  
  </code></pre>
  
  <p>My class <strong>Equipe</strong> : </p>
  
  <pre><code>public class Equipe implements Serializable{
      private String nom;
      private String ligue;
      private int classement;
      private int pts;
      private int matchJouer;
      private int victoire;
      private int defaite;
      private int matchNul;
      private int butPour;
      private int butContre;
      private String entraineur;
      private String entraineurAdj;
   }
  </code></pre>
  
  <p>If anyone can help, i thought the error was just the Equipe implements but i seems like it's not.</p>