Easy Hastable Question
Hi, I'm new to Jave, and programming in general so excuse me for asking a simple question.
I have a Hashtable on a client server which I have to extract the email address given a name, and the name given an email address.
//Set up hash table with test data
emails = new Hashtable();
emails.put("Ince","ince@hotmail.com");
emails.put("Roberts","roberts@hotmail.com");
emails.put("Timms","timms2@yahoo.com");
emails.put("Rowlands","Rowlands@tiny.com");
emails.put("Eustace","Eustace@yahoo.com");
emails.put("Lord","Lord3@hotmail.com");
String staffName="";
String staffEmail="";
........
I can use the following code to get the email address staffEmail given the name staffName;
staffEmail = (String)emails.get(staffName);
But don't know how to get the reverse and obtain the name given the email?
I'm sure it's a really simple question so please help me if you can!!!
Thanks

