Normally the deserialization is done in the following way:
PersistentTime time = null;
time = (PersistentTime)ois.readObject();
where ois is ObjectInputStream object and PersistentTime is the class we want to deserialize to.
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?
Of course; you’re doing that already! But if you want to save the typecast for later: