Jsonobject jsonarray JSON string HASHMAP arrylist data structures used in Java development

Source: Internet
Author: User

1.JSONObject

grow into this: {"Key1": value1, "Key2": value2, "Key3": Value3}

Most of the way: {Attribute 1: Property value 1, Property 2: Property value 2} important is the value of the property inside, which can put a lot of things

Key must be a string, value can be a valid JSON data type (string, number, object, array, Boolean, or null) (that is, object is possible)

**************

************************

The value of the Loop property

for (var x in obj) {
Console.log (Obj[x]);
}

***************************

Jsonarray:

In a JSON object, the property value is just a specific atom in a, and the JSON array is a combination of many atomic individuals

The array value in JSON must be a valid JSON data type (string, number, object, array, Boolean, or null). Mark as a

["Hello", 111 , True, null , [111, "Hello"] , {"1": 123, "2": [[i]} ]

These are individually tagged property values for JSON objects (a collection of theJSON object's property values is a JSON array)

*****************

********************************************

Arrylist's got some kind of element in it.

***************************************

HashMap are unordered, generally stored <string, object> these key value pairs

*************************************

Do some comparisons

As with JSON objects, values can be directly found by key

Jsonarray and Arrylist are positioned directly to the element value via the 0123 index Jsonobject and HashMap Navigate to the attribute value via key (come back to eat when thought)

——————————————————————————————————

Jsonobject jsonarray JSON string HASHMAP arrylist data structures used in Java development

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.