Java - Interface Marker Interfaces

What is Marker Interface?

An interface with no members is a marker interface.

interface Able {

}

Java API has many marker interfaces. For example.

  • java.lang.Cloneable,
  • java.io.Serializable, and
  • java.rmi.Remote

Annotation

Java has a specialized form of interface known as annotations.

It associates a meaning to any element, for example, a class, a method, a variable, a package, etc., of a Java program.