we know that serialization is null We do? I can't imagine what this might mean.
"I'm not back." - Bill Harding, Twister
Joined: Oct 10, 2002
hi jim, Actually i was asked this question in an interview. I said that serialization interface is an null interface, the next question he asked me was . Q./U say that serialization is null and it serialises an object,is there any advantage in using this??? I said that since it is null,so there is no resource used when we implement this interface. Is there any u can say about this discussion??
Originally posted by senthil sen: I said that serialization interface is an null interface
1. It is not a "null" interface. i mean even if it is not having any methods, the interface will inherit all the method opertation(operation is the method without implementations) of java.lang.Object's class. So, i java there is NO interface which doesn't have any operations. 2. but generally, We define interfaces, without operations to act as a "Marker". Look for Marker design pattern in the UML,Patterns forum. Also check for "contract based design by Alister cokcBurn". The "Marker" interface defines the contract (a mere presence of the type) which needs to get adhered by the implementing classes. a "Marker" interface is a pure type and there is no "service" a.k.a operations attached with the type.
I said that since it is null,so there is no resource used when we implement this interface.
Any class (implements an interface or not ) is used to create objects and objects will hold resources(memory).