Code example for InvalidObjectException

0
    private static final long serialVersionUID = 0; 
  } 
 
  private void readObject(ObjectInputStream stream) 
      throws InvalidObjectException { 
    throw new InvalidObjectException("Use SerializedForm"); 
  } 
 
  @Override Object writeReplace() { 
    return new SerializedForm(collection); 
  } 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE