1. When does it make sense for a Java object to be Serializable but not Cloneable? stackoverflow.comIf a Java class implements the
|
2. Serializable, cloneable and memory use in Java stackoverflow.comI am using an inner class that is a subclass of a HashMap. I have a |
3. Doubt abt Serializable,Set,Cloneable Interface coderanch.comThese are "marker" interfaces which have been discussed around the ranch quite a bit the last few days. Most folks see them as an abuse of the interface feature of the language because they define no behavior. Some like Cloneable are even worse because the behavior method is there with or without the interface. Markers are there to declare an object's ... |
4. difference between cloneable and serializable coderanch.comUm, I think you can implement clone() using the serialisation method. Normally, when one implements clone(), one calls super.clone() to do a shallow copy, then does whatever extra stuff is required. But for the serialisation method, you don't call super.clone() at all; you do all the copying yourself. I don't recommend this approach. In fact, I don't recommend using clone() at ... |
5. make effort for Serializable, Cloneable, toString() forums.oracle.comhello. I am trying to design a library. When possible, should i take extra efforts to implement Cloneable, Serializable, and override "toString()", even if I cannot think of a current situation where this might be useful? What do Java programmers think about this? Any other standard Interfaces or methods to implement/override? I read about problems of the Cloneable interface. Both look ... |