Originally posted by ritwik roy:
hi
i have some specific questions on marker interfaces
1.Though there are no methods in marker interfaces like java.io.Serializable , how the serialization will be done?
I don't consider this a marker interface. Either way, if you create the marker, one can resonably assume you know what to do when you see the marker. Like say, use reflection. Serializable methods are private.
Originally posted by ritwik roy:
2.The relevent clone() method could have been moved out of the Object class into the relevent Cloneable interface - and thus the Cloneable interface would no longer be marker interface. But it is not done ,why?
Thanks
Ritwik
Because then clone() would be coderanch. clone should not be coderanch. Its a special facility provided by Java. clone should not be used alone, but should be used to help you construct proper copies of your objects.
[ June 12, 2006: Message edited by: Mr. C Lamont Gilbert ]