This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
how can i put an object as the value in a hashmap eg hashMap.put("some key" , Object); in my code i have a user enter in a jewel color where it should look up the hash table with the jewel colour as the key returning the jewel as an object in which i can then manipulate with other methods. how do i do this? thankyou
You seem to be asking to different questions at the same time. First you say you want to "put" a value, this implies you wish to assign an value into the hashmap. Than you say you want to "look up", which implies you want to extract a value. The answer to assigning a value was posting by Marilyn. To extract a value you can the "get" method.
Please ignore post, I have no idea what I am talking about.