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 26 27 28 29 30 31 32 33 34 35 36
   | public struct elt
  {
    public string nom;
    public int age;
  }
 
  public interface Itf
  {
    elt Personne { get; set; }
    elt afficher(string prenom);
  }
 
  class TF : Itf
  {
    private elt personne;
 
    public elt Personne { get { return personne; } set { personne = value; } }
 
    public TF(string nom, int age)
    {
      personne.nom = nom;
      personne.age = age;
    }    
 
    public elt afficher(string prenom)
    {
      if (Personne.nom == prenom)
      {
        return Personne;
      }
      else
      {
        return new elt();
      }
    }
  } | 
Partager