Marker interface is an interface without any members. And serializable is one example for that .
Can we define our own marker interface. If yes how can we define functionality for it.?
Marker interface is used as a tag to inform a message to the java compiler so that it can add special behaviour to the class implementing it.
Java marker interface has no members in it.
Ex. 1. java.io.Serializable is Marker interface.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With