Interface Types
- Interface type describes a set of methods
- No implementation, no state
- Class implements interface if it implements its methods
- In UML, use stereotype «interface»

Java Interface Example
Interface definition in file Comparable.java:
/**
Interface for comparing with another Message object.
*/
public interface Comparable {
/**
compare this with another message.
@param msg the other message
@return -1 if this message is older than msg, 0 if this.equals(msg),
and +1 if this message is more recent than msg.
*/
public int compareMessage(Message msg);
};
Class Message
implements this interface
(in file Message.java):
public class Message implements Comparable {
....
public int compareMessage(Message msg)
{
// method implementation body
}
....
};