Bonjour,
J'ai un probleme de récuperation des paramètres
resultat
Code : 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 public class F{ public ArrayList<String> Element(double p, double n) { ArrayList<String> tableau = new ArrayList<String>(); tableau.add("000"); tableau.add("001"); tableau.add("011"); tableau.add("111"); return tableau } public LinkedHashMap<Integer, ArrayList<String>> MaChaine(ArrayList<String> tableau) { LinkedHashMap<Integer, ArrayList<String>> copieChaine = new LinkedHashMap<Integer, ArrayList<String>>(); .... copieChaine.put(0,"000"); copieChaine.put(1,"001"); copieChaine.put(2,"001", "111"); return copieChaine; } public static void main(String[] args) { ArrayList<String> t = new ArrayList<String>(); LinkedHashMap<Integer, ArrayList<String>> copieChain = new LinkedHashMap<Integer, ArrayList<String>>(); double p = 4; double n = Math.pow(2, p); F elt = new F(); t = elt.Element(p,n); copieChain = elt.MaChaine(t); System.out.println("Chaine dans Main: "+ copieChain); } }
Pq? les clé du LinkedHashMap sont mentionnées et les valeurs ne sont pris avec?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 Chaine dans Main: {0=[], 1=[], 2=[]}
Merci d'avance
Partager