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

doubt on HashMap

 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

i have 2 questions

1) what is the difference between ArrayList and LinkedList

2) how to get the key value from HashMap

please can any one tell me the solution...

Thanks & Regards,
seetharaman.v
 
Katrina Owen
Sheriff
Posts: 1367
18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

For LinkedList vs ArrayList, could you be more specific? Are you asking about performance differences between the two data structures?

For the HashMap, I'd suggest that you take a look at the API, try to apply what you find there in an example, and if you get stuck, show us what you've got, and we'll help you figure out what went wrong.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Katrina,

well, i looked the api... my question is how you will get the keys from hashmap..

second thing) what is the performance (datastructure) difference between ArrayList and LinkedList
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by seetharaman venkatasamy:
...well, i looked the api... my question is how you will get the keys from hashmap...

Didn't you see the method keySet()?

For differences among Lists, see Choosing between Lists from Eckel's Thinking in Java.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot katrina and marc
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic