• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hash table

 
sudesh shankar
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
write a program that accepts the name of a city as its command line argument .display the name of the country in which that city is located.store the city and country strings in a hash table.
provide appropriate feedback if the user doesnot include a command line argument or specifies a city that is not in the hash table.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I take it that's an assignment you have to complete. Note that here at the Ranch, we're excited about helping people learn Java -- and very, very against people doing other people's homework for them.

In that vein, I'm afraid you won't be getting any help at all until you show us what you have so far, and ask for specific help on how to proceed.

[ EJFH: Note added later: ]

I see that you've posted all the questions from a whole test or interview here, each question in a separate thread. I've gone ahead and deleted all those for you, to save you the trouble of doing it yourself. Come back and post some specific questions when you have them; otherwise, you'll need to find some other way to cheat.
[ July 13, 2006: Message edited by: Ernest Friedman-Hill ]
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
a NullPointerException or IllegalArgumentException are usually pretty good feedback.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic