2 <clause number="20.4" title="Interface implementations">
3 <paragraph>Interfaces may be implemented by classes and structs. To indicate that a class or struct implements an interface, the interface identifier is included in the base class list of the class or struct. <example>[Example: For example: <code_example><![CDATA[
10 int CompareTo(object other);
12 class ListEntry: ICloneable, IComparable
14 public object Clone() {...}
15 public int CompareTo(object other) {...}
17 ]]></code_example>end example]</example> </paragraph>
18 <paragraph>A class or struct that implements an interface also implicitly implements all of the interface's base interfaces. This is true even if the class or struct doesn't explicitly list all base interfaces in the base class list. <example>[Example: For example: <code_example><![CDATA[
23 interface ITextBox: IControl
25 void SetText(string text);
27 class TextBox: ITextBox
29 public void Paint() {...}
30 public void SetText(string text) {...}
32 ]]></code_example></example></paragraph>
34 <example>Here, class TextBox implements both IControl and ITextBox. end example]</example>