I would like to deep clone a List. for that we are having a method
// apache commons method. This object should be serializable
SerializationUtils.clone ( object )
so now to clone my List i should convert that to serializable first. Is it possible to convert a List into Serializable list?
This question is related to
java
serialization
collections
apache-commons
As pointed out already, most standard implementations of List
are serializable. However you have to ensure that the objects referenced/contained within the list are also serializable.
List is just an interface. The question is: is your actual List implementation serializable? Speaking about the standard List implementations (ArrayList, LinkedList) from the Java run-time, most of them actually are already.
Source: Stackoverflow.com