It's not like that 'marker interface' does nothing? If you dig inside this 'Serializable' interface, you will come to know how does this work. There are 'writeObject' and 'readObject' kind of methods hidden behind the scene.
A marker interface is there just so we can ask an object if it has the marker. In this case a serializer might have a whole collection of objects or one object that has references to a bunch of others. The serializer can ask each object "Do you want to be serialized?" If the marker interface is not present, the serializer skips it.
Do you know how to test if an object implements an interface? See if you can find a Java operator to do the job!
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi