Could somebody pls explain the contract of marker interfaces in java?
For Ex: If Clonable is a Marker Interface with no fields/methods, then where is t
A marker interface is a common technique to tag classes. They don't add behaviour to classes (in general). The Clonable interface is such a tag: every class tagged with Clonable is able to clone itself (that's the rule).
Same with Serializable, although there is some more hidden magic behind that marker interface (the object serializer looks for some methods and fields, that the tagged class may implement or not)
Bonus info: forget about Clonable, its broken. If you want to create clones in real life, look for the copy constructor pattern.