I have an interesting question which entails the use of Hashtables
; I'm developing for S40 Nokia's (with compliance level 1.4)
How I expect the Hashtable
to work:
Hashtable table = new Hashtable();
table.put(1, "Hello World");
However I get the error:
The method
put(Object, Object)
in the typeHashtable
is not applicable for the arguments(int, String)
However when I create an object reference and pass the reference, it works fine! Why?!
Working example:
Hashtable table = new Hashtable();
Integer test = new Integer(1);
table.put(test, "Hello World");
Any explanations would be great!
table.put((object)1,"Hello, World");
– Galenictable.put(1, "Hello World");
This really causes the error you have described. I checked it under 1.4 and it behaves exactly as you described, but not with the code you provided. – Flashing