hi can somebody help me with this problem i need to be able to do the follow exemple:
-------------------------------------------------------------------------
import java.util.Map;
HashMap<Integer,Integer> hm = new HashMap<Integer,Integer>();
hm.put(1, 1); hm.put(2, 35); hm.put(3, 36); ~int a ;
for (Map.Entry me : hm.entrySet()) {
print(me.getKey() + " is ");
println(me.getValue());
a = me.getKey();
//the red part is wrong because the compiler says that me.getKey(); is a object and not an integer
// but when u do print(me.getKey()) ,it will be printed s an integer
}
-------------------------------------------------------------
note: BLUE = CORRECT; RED = INCORRECT;
can somebody plz help me with this problem?sorry for the english
:D ty
------------------------------------------------------------------------
in one of my projectes, it occour a porblem that can be solved in follow way:
i want to be able to have similar thing to ArrayList, but instead i call the object by his position on the "array", i call it for a integer that is attached to the object in the array