What exactly is marker interface in Java?

Technology CommunityCategory: JavaWhat exactly is marker interface in Java?
VietMX Staff asked 3 years ago

The marker interface in Java is an interfaces with no field or methods. In other words, it an empty interface in java is called a marker interface. An example of a marker interface is a SerializableClonable and Remote interface.

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.