当前位置: 首页 > Web前端 > JSON > 正文

JAVA解析JSON数据

2018-04-24 来源:cnblogs/monsterlin

在使用第三方api的使用,有时候会从网络中获得json数据,所以说我们将如何解析json数据?

下面小编将通过以下几点来进行json的讲解

1.什么是JSON? (http://www.json.org/)

JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition - December 1999. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others. These properties make JSON an ideal data-interchange language.

image

image

(图片来自:http://www.cnblogs.com/xiaoluo501395377/p/3446605.html)

2.Json数据类型

2-1.json对象

image

2-2.json数组

image

ps:JSONObject与JSONArray的区别

image(JSON数组)

image(JSON数组)