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这是为什么啊?
添加回答
举报
0/150
提交
取消