• Post Reply Bookmark Topic Watch Topic
  • New Topic

HashMap and for each loop  RSS feed

 
Anne Saizan
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello there,
I really need you guys help.
I've got this problem



I don't know what is the error with for each loop.
it does not display anything in the box.
Hope you guys can guide me.

Thanks
 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the return type of users.values(). Is that a List<Shopper>. Can you print its size and see it has any elements added?
 
John Jai
Rancher
Posts: 1776
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If users is an HashMap, then you will get a Collection<Shopper> when you call the users.Values(). Still you can print the Collection<Shopper> size to ensure its greater than zero.
 
Anne Saizan
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay thanks.
=)
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!