package project001.test;
import java.util.ArrayList;
import net.sf.json.JSONArray;
public class PersonTest {
private int num;
public int getNum() {
return num;
}
public void setNum(int num) {
this.num = num;
}
public static void main(String args[]){
String obj = "[ {\"num\":549033428509} ]";
JSONArray jsonArr = JSONArray.fromObject(obj);
ArrayList<PersonTest> list1 = (ArrayList<PersonTest>)JSONArray.toList(jsonArr,PersonTest.class);
PersonTest p1 = list1.get(0);
System.out.println(p1.getNum());
}
}
为什么打印的结果是:-722385379
而我的num值,明明是549033428509
这是为什么啊?
相关分类