This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes How to find the number of occurences in a list using Java API Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How to find the number of occurences in a list using Java API" Watch "How to find the number of occurences in a list using Java API" New topic
Author

How to find the number of occurences in a list using Java API

santhosh.R gowda
Ranch Hand

Joined: Apr 06, 2009
Posts: 296
Dear All,

I want to know how to find the total number of ocuurences of each Object in an List is there any Method in Java to find with out doing our own logic
Please let me know with example


Creativity is nothing but Breaking Rules
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

is there any Method in Java to find with out doing our own logic

No.


[My Blog]
All roads lead to JavaRanch
santhosh.R gowda
Ranch Hand

Joined: Apr 06, 2009
Posts: 296
Thanks Sir
Karthik Shiraly
Bartender

Joined: Apr 04, 2009
Posts: 711
    
  14

Hi,

You can use Collections.frequency() to get the number of occurrences.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to find the number of occurences in a list using Java API
 
jQuery in Action, 3rd edition