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 implementationsprevious at this levelnext at this level 20.4.5 Abstract classes and interfaces Paragraph 11 Like a non-abstract class, an abstract class must provide implementations of all members of the interfaces that are listed in the base class list of the class. 2 However, an abstract class is permitted to map interface methods onto abstract methods. [Example: For example
interface IMethods  
{  
   void F();  
   void G();  
}  
abstract class C: IMethods  
{  
   public abstract void F();  
   public abstract void G();  
}  
Here, the implementation of IMethods maps F and G onto abstract methods, which must be overridden in non-abstract classes that derive from C. end example] Paragraph 21 Note that explicit interface member implementations cannot be abstract, but explicit interface member implementations are of course permitted to call abstract methods. [Example: For example
interface IMethods  
{  
   void F();  
   void G();  
}  
abstract class C: IMethods  
{  
   void IMethods.F() { FF(); }  
   void IMethods.G() { GG(); }  
   protected abstract void FF();  
   protected abstract void GG();  
}  
Here, non-abstract classes that derive from C would be required to override FF and GG, thus providing the actual implementation of IMethods. end example]
{ JSL }
Jagger Software Ltd
Company # 4070126
VAT # 762 5213 42
Valid HTML 4.01Valid CSS