title: Two different objects on the same socket in Java
body: <p>Sender:</p>
  
  <pre><code>ObjectA A = new ObjectA();
  ObjectB B = new ObjectB();
  //Connection is created
  socket.writeObject(B);
  </code></pre>
  
  <p>Receiver:</p>
  
  <p>//don't know how to find to which object I should typecast the object to :(</p>
  
  <p>Is there any way to send two different objects on the same Object stream?</p>
  
  <p>-Pk</p>