Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

affichage de HashMap<String, List<String>>

 
christophe seguinot
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bonjour,

j'ai le code suivant :
HashMap<String, List<String>> categoryIngredients = new HashMap<String, List<String>>();
List<String> ingredient1s = new ArrayList<String>();
ingredient1s.add("ing1");
ingredient1s.add("ing2");
List<String> ingredient2s = new ArrayList<String>();
ingredient2s.add("ing3");
ingredient2s.add("ing4");
categoryIngredients.put("viande", ingredient1s);
categoryIngredients.put("fruit", ingredient2s);

Je voudrais pouvoir afficher :
viande fruit
ing1 ing3
ing2 ing4

Mais je ne vois absolument pas comment faire.

Merci
 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Salut,

Je ne parle pas francais. Try english.
 
Rob Spoor
Sheriff
Posts: 20822
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Odd. A year ago English wasn't a problem for Christophe.
 
this is supposed to be a surprise, but it smells like a tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!