怎么用java代码解析下面的json数据?????
[{"krnum":0,"kname":"娱乐","kid":1},{"krnum":0,"kname":"生活","kid":2},{"krnum":0,"kname"...
[{"krnum":0,"kname":"娱乐","kid":1},{"krnum":0,"kname":"生活","kid":2},{"krnum":0,"kname":"财经","kid":3},{"krnum":0,"kname":"购物","kid":4},{"krnum":0,"kname":"科技","kid":5},{"krnum":0,"kname":"健康","kid":6},{"krnum":0,"kname":"旅游","kid":7},{"krnum":0,"kname":"体育","kid":8},{"krnum":0,"kname":"军事","kid":9},{"krnum":0,"kname":"文化","kid":10},{"krnum":0,"kname":"其他","kid":11}]
展开
3个回答
展开全部
JSONObject.toBean(jsonObject, clazz);
使用json-lib包,clazz是你要转成类的class
这只是转换成javabean的,还有其他的转换方式
使用json-lib包,clazz是你要转成类的class
这只是转换成javabean的,还有其他的转换方式
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
有个工具包jsonobject
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询