recuperer le contenu d'une variable
Bonjour
comment puis je recuperer m( en rouge) pour l'utilier dans l'autre methode.
l'usage de la commande ne marche pas
car m contient les clés et les valeurs
Code:
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
| class graph{
public LinkedHashMap<Integer, ArrayList<String>> graphe(Integer i,
ArrayList<String> chaine) {
LinkedHashMap<Integer, ArrayList<String>> m = new LinkedHashMap<Integer, ArrayList<String>>();
LinkedHashMap<Integer, ArrayList<String>> antichaine = new LinkedHashMap<Integer, ArrayList<String>>();
StringBuffer buf = new StringBuffer();
graph gr = new graph();
//i et chaine sont passé en parametre venant d'une autre methode
m.put(i, chaine);
System.out.println("chaine: " + m);
gr.antichaine(m);
return m;
}
public void grap(Integer i,ArrayList<String> chaine){
graph gr = new graph();
SortedMap<Integer,ArrayList<String>> sMap;
//comment recuperer m ???
}
} |