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
  • 6

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
  • 90,369
  • 161
  • 124
  • 175
NiVeR
  • 9,280
  • 4
  • 29
  • 34