View Single Post
  #1 (permalink)  
Old 12-23-2007, 01:18 PM
new_1 new_1 is offline
Member
 
Join Date: Dec 2007
Posts: 5
new_1 is on a distinguished road
Hashtable-put method
Hi,
I wrote a code, below is a part of it(using NetBeans IDE 6.0)
Code:
............. Hashtable<String, Integer> numbers= new Hashtable<String, Integer>(); numbers.put("one", 1); numbers.put("two", 2); numbers.put("three", 3); ............
Problem is the following:
-in tutorials i read put() method just puts the parameter in the table(we didnt have to write n=numbers.put("one", Integer(1)) ).
-when i wrote the above code, there was an error telling me that put() method returns an Integer.
Help me understand please.
Thanks.

Last edited by new_1 : 12-23-2007 at 01:21 PM.
Reply With Quote
Sponsored Links