0

I just need some clarifications regarding marker interface in java. I have read that its an empty interface in java. I just want to know why and where we need to use this. Can anyone please help.

Anu
  • 51
  • 7

1 Answers1

1

Shortly said, it is used to mark (or annotate) types with some information that the JVM compiler will use. For instance, the Serializable is a marker interfaces that a type must implement if it needs to have its state persisted (serialized and deserialized).

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
NiVeR
  • 9,644
  • 4
  • 30
  • 35