Is it possible to serialize a TreeMap with a comparator??
I’ve tested and it serializes well a treemap without comparator, when you add the comparator, it throws an exception.
If I declare comparator as transient, it still doesn’t work. It only works if I make every tree map transient but it doesnt serialize the trees in that case.
All the classes which you attempt to serialize must implement the
java.io.Serializableinterface. Also, each member variable in your class should beSerializable. In fact, your whole hierarchy should be.