I have an ArrayList which having many objects. I want to do sum of values of the same property name.
Examples Data in Array List
which is Objects of
Why you don't just put them in an Map based collection with key/value pairs ?
I think that in this case a Map based collection is more suitable, for the data you have and the context in which you want to use it.
If you need to preserve the single items inside the list, you could use a linked list as Value of the map .
For example :
HashMap> cache = new HashMap>();
and SUM each element of the value LinkedList to find the total amount ... You could even wrap the LinkedList of doubles into a container object with helper functions like getTotal() or Sum().