示例#1
0
        static void Main(string[] args)
        {
            IEnfant oEnfant1 = new Enfant(10, "Enfant1", 100);
            IEnfant oEnfant2 = oEnfant1.getCopy().setS("Enfant2");

            Console.WriteLine(oEnfant1.getAsString());
            Console.WriteLine(oEnfant2.getAsString());

            //
            Console.WriteLine("\n\n---------\n\n");

            //oEnfant1.getAsIInterf().setS("xx"); //Interdit évidemment car ce que renvoie getAsIInterf() est de type IInterf et NON IEnfant.


            Console.WriteLine("OK");
            Console.ReadKey();
        }
示例#2
0
 public Client1(IEnfant poEnfant) : base(poEnfant) //<<<< Param. de type plus spécifique que le constructeur de la classe parente Client1
 {
 }