0

So my question is, why serializable interface does not contain methods or fields?

When we can use Serializable interface?

What happen during deserialization?

user207421
  • 305,947
  • 44
  • 307
  • 483
ravibagul91
  • 20,072
  • 5
  • 36
  • 59

3 Answers3

0

Serializable interface is a "Marker"or "Tagging" interface. Whenever a class implements the serializable interface, that class is "marked" as serializable and the objects of the class are given that property.

TheLostMind
  • 35,966
  • 12
  • 68
  • 104
0

Serializable interface is termed as 'Marker' interface. This interface has been created to let JVM know that these Object types are allowed to be serialized and deserialized. You would have directly read the documentation instead of posting this question on SO.

user207421
  • 305,947
  • 44
  • 307
  • 483
Keerthivasan
  • 12,760
  • 2
  • 32
  • 53
0

1) Java serialization does not need any methods.

2) You can use Serializable when you create a new class and you want it to be serializable

3) During serialization object class descriptors and then object fields are sent to a stream.

Details are here http://docs.oracle.com/javase/7/docs/technotes/guides/serialization/index.html

Evgeniy Dorofeev
  • 133,369
  • 30
  • 199
  • 275