|
Exemple 13-8 extrait du chapitre
La généricité
Exemple 13-7< > Exemple 13-9
Cet exemple peut être compilé avec la ligne de commande: csc.exe /target:library Exemple_13_8.cs Erreurs: 0 Avertissements: 0 Remarque:
Exemple_13_8.cs
interface ICustomInterface1 { int Fct1(); }
interface ICustomInterface2 { string Fct2(); }
class BaseClass{}
class C<U>
where U : BaseClass, ICustomInterface1, ICustomInterface2, new() {
public string Fct(U u) { return u.Fct2(); }
}
Copyright Patrick Smacchia 2006 2007
|