Json getting started tutorial + some convenient operations in java

Source: Internet
Author: User
JSON (JavaScriptObjectNotation) is a lightweight data exchange format, which is very suitable for server-to-JavaScript interaction. Compared with XML, XML is easier to read and write. It is a subset of JavaScript. JSON is in a language-independent text format.

JSON (JavaScript Object Notation) is a lightweight data exchange format, which is very suitable for server-to-JavaScript interaction. Compared with XML, XML is easier to read and write. It is a subset of JavaScript. JSON is in a language-independent text format and can be used in popular languages, such as C # Java C ++ VB. These features make JSON an ideal data exchange language.
I. Json construction structure
1. A collection of name/value pairs ). In different languages, it is understood as an object, record, struct, dictionary, and hash table ), keyed list or associative array ).
2. An ordered list of values ). In most languages, it is understood as an array ).
These are common data structures. In fact, most modern computer languages support them in some form. This makes it possible to exchange a data format between programming languages that are also based on these structures.
II. Specific JSon Representation
1. The object is an unordered set of 'Key/value' pairs. An object starts with "{" (left parenthesis) and ends with "}" (right Parenthesis. Each "name" is followed by a ":" (colon); "," (comma) is used to separate the "name/value" pairs.

2. An array is an ordered set of values. An array starts with "[" (left square brackets) and ends with "]" (right square brackets. Values are separated by commas.

3. The value can be a string, a number, true, false, null, an object, or an array enclosed in double quotation marks ). These structures can be nested.

4. A string is a collection of any number of Unicode characters enclosed by double quotation marks. It is escaped using a backslash.
A character (character) is a separate string (character string ). A string is very similar to a C or Java string.

5. The value (number) is also very similar to the value in C or Java. Remove unused octal and hexadecimal formats. Except for some encoding details.

In javascript
[Javascript] view plaincopyprint?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.