Bonjour/Bonsoir
je veux que enfant soit un arraylist de personne.
Code C# : Sélectionner tout - Visualiser dans une fenêtre à part
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87 class Personne { //creation du chemin du fichier const string path = "\\C\\Exo1\\personnes.txt"; //atributs protected string nom; protected string prenom; protected int age; protected ArrayList enfant; //constructeur par default public Personne() { this.nom = "SARR"; this.prenom = "Babacar"; this.age = 24; } //constructeur value public Personne(string Nom, string Prenom, int age, ArrayList Enfant) { this.nom = Nom; this.prenom = Prenom; this.age = age; this.enfant = Enfant; } //constructeur de copie public Personne(Personne personne) { this.nom = personne.nom; this.prenom = personne.prenom; this.age = personne.age; this.enfant = personne.enfant; } //les proprietes get et set pour l'attribut nom; public string Nom { get { return this.nom; } set { this.nom = value; } } //les proprietes get et set pour l'attribut Prenom public string Prenom { get { return this.prenom; } set { this.prenom = value; } } //les proprietes get et set pour l'attribut age public int Age { get { return this.age; } set { this.age = value; } } //les proprietes get et set pour l'attribut enfant public ArrayList Enfant { get { return this.enfant; } set { this.enfant = value; } }
merci d’avance
Partager