Json数据之Gson解析
来源:互联网 发布:慈溪行知职高大学生 编辑:程序博客网 时间:2024/06/05 11:05
public void test() throws IOException { String jsonString = "[{\"username\":\"xujiaowei\",\"userId\":\"28\"},{\"username\":\"Jason\",\"userId\":\"002\"}}]"; JsonReader jsonReader = new JsonReader(new StringReader(jsonString)); jsonReader.beginArray(); while (jsonReader.hasNext()) { jsonReader.beginObject(); while (jsonReader.hasNext()) { String name = jsonReader.nextName(); if (name.equals("username")) { System.out.println(jsonReader.nextString()); } if (name.equals("userId")) { System.out.println(jsonReader.nextInt()); } } jsonReader.endObject(); } jsonReader.endArray(); }
阅读全文
0 0
- Json数据之Gson解析
- Android解析Json数据之Gson解析
- Andorid之Gson解析Json数据
- Android之使用GSON解析JSON数据
- Android开发之Gson解析json数据
- Gson解析Json数据
- Gson解析Json数据
- Gson解析Json数据
- Gson解析json数据
- Gson解析json数据
- Gson解析Json数据
- Gson解析Json数据
- gson 解析json数据
- GSON解析json数据
- Gson解析Json数据
- Gson解析Json数据
- Gson解析json数据
- Gson解析json数据
- mongodb简介
- windows下编译libuv的问题。
- 在设置边距不管用的时候可以试一试
- 9.2 2048 SSL2713
- 找出连续子向量的最大和
- Json数据之Gson解析
- 【拜小白opencv】27-图像噪声2——高斯噪声
- [LeetCode] 543. Diameter of Binary Tree
- iOS使用ShareSDK分享显示中文
- Tensorflow学习笔记(6)——变量管理和模型持久化
- NLP 常用语料库
- 机器学习之Adaboost
- [中等] UVa OJ 12325 Zombie's Treasure Chest 另类枚举
- CountDownLatch理解一:与join的区别