How to map string to number in java? -


given text string "apple", want obtain number. every time apple same number. how can done in java?

thank you.

edit: well, think didn't explain myself well. mean existing java function implements map this. example of function be: a->1, b->2, c->3,...

apple -> 11616125 

this maps for.

map<string, integer> lookup = new hashmap<string, integer>(); lookup.put("apple", 1); lookup.get("apple"); // returns 1 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -