日期:2014-05-20  浏览次数:20907 次

The 'year' argument must be in range 1900 to 9999.
如题。
代码如下:
for (int i = 0; i < list.size(); i++) {
List obj = (List) list.get(i);
int year = 0;
int month = 0;
int day = 0;
int hour = 0;
int min = 0;
for (int j = 0; j < obj.size(); j++) {

if (j == 0) {
year = Integer.parseInt(obj.get(0).toString().substring(0,
4));
month = Integer.parseInt(obj.get(0).toString().substring(4,
6));
day = Integer.parseInt(obj.get(0).toString().substring(6,
8));
hour = Integer.parseInt(obj.get(0).toString().substring(8,
10));
min = Integer.parseInt(obj.get(0).toString().substring(
10, 12));
}
if (j == 1) {
time3.add(new Minute(min, new Hour(hour, new Day(day, month, year))),
Float.parseFloat(obj.get(1).toString()));
}
if (j == 2) {
time1.add(new Minute(min, new Hour(hour, new Day(day, month, year))),
Float.parseFloat(obj.get(2).toString()));
}
if (j == 3) {
time2.add(new Minute(min, new Hour(hour, new Day(day, month, year))),
Float.parseFloat(obj.get(3).toString()));
}
}

说这句话有问题
if (j == 1) {
time3.add(new Minute(min, new Hour(hour, new Day(day, month, year))),
Float.parseFloat(obj.get(1).toString()));

希望各位大侠停下你们的脚步 看看 瞧瞧

------解决方案--------------------
起码你不能全转成String 类型啊,可以用New Integer()这样你试试具体行不行我不知道