Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Retrieve Value with out key in hashmap

 
Rajendra Prakash
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can you retrieve values in hashmap with knowing key . Is there any possibllit to get from another class
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you want to do exactly ? Retrieve all values in the Map ? Did you check the API ?
 
Campbell Ritchie
Sheriff
Pie
Posts: 49405
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you read the methods of the Map interface? I think one of those will provide what you want.
 
Rajendra Prakash
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my interviewer asked. how can you retrieve values from hashmap consider keys are not known to you.He asked
me can you get key from another class.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49405
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
. . . and what did you say?
 
Rajendra Prakash
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any possibility to retrieve hashmap values from another class . This is possible or not
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:Have you read the methods of the Map interface? I think one of those will provide what you want.

I think so, too :-)
 
Campbell Ritchie
Sheriff
Pie
Posts: 49405
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't understand your reply; you appear simply to be repeating what you said earlier.
 
Rob Spoor
Sheriff
Pie
Posts: 20549
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So let's reply the answer as well.
Campbell Ritchie wrote:Have you read the methods of the Map interface? I think one of those will provide what you want.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic