title: writing generic-type objects to file java
body: <p>Is it even possible? I need to be able to read from the file later on.
  example of what I intend doing (but doesn't work because E isn't Serializable):</p>
  
  <pre><code>private &lt;E&gt; void writeEvent(ObjectOutputStream out,E obj) throws IOException{
          out.writeObject(new custEvent(obj));
          }
  
  class custEvent&lt;E&gt; implements Serializable{
          private E obj;
          private Date date;
  
          public custEvent(E obj) {
              this.obj=obj;
              date=new Date();
          }
      }
  </code></pre>