热门搜索:
{ name :"xqz",age:21,friends:["wzj","cgj","wl"] }
public class JavaBean { }
JavaBean { /** * name : xqz * age : 21 * friends : ["wzj","wl"] */ private String name; private int age; private List<String> friends; public String getName() { return name; } void setName(String name) { this.name = getAge() { age; } void setAge( age) { this.age =public List<String> getFriends() { friends; } void setFriends(List<String> friends) { this.friends = friends; } }
String jsonStr = " { name :\"xqz\",friends:[\"wzj\",\"cgj\",\"wl\"] }"; JavaBean javaBean = new Gson().fromJson(jsonStr,JavaBean.); LogUtils.logi("MainActivity",javaBean.getName()+",age:" +javaBean.getAge()+",friends:"+javaBean.getFriends().toArray());
implementation 'com.alibaba:fastjson:1.2.59'
String jsonStr = " { name :\"xqz\",1)">; JavaBean javaBean =JSON.parSEObject(jsonStr,new JavaBean); LogUtil.logi("MainActivity",age:" +javaBean.getAge()+",friends:"+javaBean.getFriends().toArray());
本站采用系统自动发货方式,付款后即出现下载入口,如有疑问请咨询在线客服!
咨询售后客服