Bookmark Topic Watch Topic
  • New Topic

How Comparator and Comparable Help in Searching from a Collection  RSS feed

 
Bhavesh Sangwan
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Report post to moderator
I'm trying to find the best way to search an object with a specific field from collection. So according to my knowledge, comparator and comparable interface can help in SORTING but how they can help in SEARCHING and item from arraylist or Map with respect to object property.....?


Please help me clearing this doubt...

Thanks
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!