I have an Arraylist of Records.
package com.demo.myproject;
public class Records 
{
    String countryName;
    long numberOfDays;
    public String getCountryName() {
        return countryName;
    }
    public void setCountryName(String countryName) {
        this.countryName = countryName;
    }
    public long getNumberOfDays() {
        return numberOfDays;
    }
    public void setNumberOfDays(long numberOfDays) {
        this.numberOfDays = numberOfDays;
    }
    Records(long days,String cName)
    {
        numberOfDays=days;
        countryName=cName;
    }
}
My Arraylist<Records> is containing the values
 Singapore     12 
 Canada         3
 United Sates  12
 Singapore     21
I need to modify it such that my output is
Canada         3
Singapore     33
United States 12
Please help me with solution,approach.
 
     
     
     
    