A marker interface in Java is an empty interface that does not contain any methods, fields, or constants. It is used to associate metadata with a class where the language does not have explicit support for it. To use this pattern, a class implements a marker interface (also called a tagging interface), and methods that interact with instances of that class test for the existence of the interface. The mere presence of such an interface indicates specific behavior on the part of the implementing class. Examples of built-in marker interfaces in Java include Serializable, Cloneable, and Remote interfaces. The Serializable interface is used to indicate that an objects non-transient data members can be written to an ObjectOutputStream. The Cloneable interface indicates that it is legal for the clone() method to make a field-for-field copy of instances of that class. The Remote interface serves to identify interfaces whose methods may be invoked from a non-local virtual machine. Marker interfaces can be used to logically divide the code and categorize it, making it more useful for developing APIs and frameworks like Spring.