【发布时间】:2012-10-22 07:33:30
【问题描述】:
我有一个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
请帮我解决办法。
【问题讨论】: