title: Deserialize object without knowing its type in Java
body: <p>Normally the deserialization is done in the following way:</p>
  
  <pre><code>PersistentTime time = null;
  time = (PersistentTime)ois.readObject();
  </code></pre>
  
  <p>where ois is ObjectInputStream object and PersistentTime is the class we want to deserialize to.</p>
  
  <p>So if my application has 2 or 3 kinds of objects being sent over the network, is it possible to deserialize the object without knowing the type or know the type of object first and deserialize later according to that type?</p>