bonjour
j'essaie d'Afficher une hashmap
mais j 'ai une exception
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11 Hashtable tableHachage = new Hashtable(); tableHachage.put("one", new Integer(1)); tableHachage.put("two", new Integer(2)); for( Iterator i = tableHachage.keySet().iterator(); i.hasNext();){ String key = (String)i.next(); System.out.print("\n"+key+ ":"); for ( String st : ((String[]) tableHachage.get(key))) System.out.print( st+", "); }
Pourriez vous m'aider ?Exception in thread "main" java.lang.ClassCastException: java.lang.Integer
at Main.main(Main.java:26)
Partager