我有一个Arraylist
记录。
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;
}
}
我Arraylist<Records>
的包含值
Singapore 12
Canada 3
United Sates 12
Singapore 21
我需要修改它,以便我的输出是
Canada 3
Singapore 33
United States 12
请帮助我解决方案,方法。