Jon Jagger
jon@jaggersoft.com
Table of Contents 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Notes DownloadECMA-334 C# Language Specificationpreviousnextprevious at this levelnext at this level 20 Interfacesprevious at this levelnext at this level 20.4 Interface implementations Paragraph 11 Interfaces may be implemented by classes and structs. 2 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: For example:
interface ICloneable  
{  
   object Clone();  
}  
interface IComparable  
{  
   int CompareTo(object other);  
}  
class ListEntry: ICloneable, IComparable  
{  
   public object Clone() {...}  
   public int CompareTo(object other) {...}  
}  
end example]
Paragraph 21 A class or struct that implements an interface also implicitly implements all of the interface's base interfaces. 2 This is true even if the class or struct doesn't explicitly list all base interfaces in the base class list. [Example: For example:
interface IControl  
{  
   void Paint();  
}  
interface ITextBox: IControl  
{  
   void SetText(string text);  
}  
class TextBox: ITextBox  
{  
   public void Paint() {...}  
   public void SetText(string text) {...}  
}  
Here, class TextBox implements both IControl and ITextBox. end example]
{ JSL }
Jagger Software Ltd
Company # 4070126
VAT # 762 5213 42
Valid HTML 4.01Valid CSS