A marker interface is an interface that contains no methods but serves to mark a class for some purpose. In Java, marker interfaces are used to associate metadata with a class where the language does not have explicit support for metadata. To use a marker interface, a class implements the interface to be marked, and code interacting with instances of that class tests for the existence of the interface to determine the class's purpose. Common examples of marker interfaces in Java include Serializable and Cloneable.