Long只有这两个构造函数;所以你的强制转换是否好用,请确认 Long(long value) Constructs a newly allocated Long object that represents the specified long argument. Long(String s) Constructs a newly allocated Long object that represents the long value indicated by the String parameter.
Long(long value)
Constructs a newly allocated Long object that represents the specified long argument.
Long(String s)
Constructs a newly allocated Long object that represents the long value indicated by the String parameter.
就是说userVec.get(i)返回的对象不能转换成Long对象
也就是这个对象并不是Long对象, 至于是什么对象你应该清楚呀
也可能是循环时返回null了
long a=l.longValue();看看是否是第一句有误,否则检查userVec.get(i)是否真是Long,或者userVec.get(i)就是为null