Receive an object from the net and distinguish it
<p>I receive an object from the net through the the <code>getInputStream()</code> using <code>ObjectInputStream</code>
My question is:  once it's arrived from the net how can I distinguish it?Can i use <code>instance of</code>?</p>

<pre><code>ObjectInputStream ois = new ObjectInputStream(socket.getInputStream();

Object obj = ois.readObject();

if(obj instanceof ObjectA)
    ...
else  
    ...
</code></pre>
