Sum value Of Class Objects Property In ArrayList
问题 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 ProfitAndLossDataDO "Michel" , 5000 "Alex" , 5000 "Edvin" , 4000 "Sosha" , 3000 "Michel" , 2000 "Alex" , 3000 And the Result Would be (Sum of values when person are same)- "Michel" ,7000 "Alex" , 8000 "Edvin" , 4000 "Sosha" , 3000 The Logic class ProfitAndLossDataDO public class ProfitAndLossDataDO { String ledgerName; double ledgerAmount; public