data rate

stay here and get updated with technology

Json-c Tutorials:What is json,and why ?

What is json,and why ?

  • In very simple words, Json is a lightweight data-interchange format.
  • Unlike other format it human and machine readable .
  • Supported by many modern programing language
    • Java
    • java script
    • python
    • c/c++
    • c#
    • perl
  • Json is made up of key:value and array structure and most of the all language support this data types.So json data is inter-exchangeable between languages.
  • Json support the following data types

Number

syntax:

json_object json_object_name = { string : number_value, …….}

example:

 jobj={age:22};
PS:number should written without quotes

String

syntax:

json_object json-object-name = { string : “string value”, …….}

example:

jobj ={“Name”:”Slim”};

Boolean

Syntax:

json_object json-object-name={String:true/false,…}

example:

jobj={status:true};

Array

Syntax

json_object json-object-name={[string:[value1,value2,….]};

example:

jobj={
[
{“Name” : “Peter” , “Last name” : “Jeff”} , {“Name” : “Anny” , “Last name”                     : “clerk”} , {“Name” : “Amanda” , “Last name” : “alex”}
]
}

Object

Syntax

Json_object json-object-name={String:value,….};

example:

jobj={“Name”:”Jay” , “Age “:21 , “online”:true};

So json is very robust in handling almost all kinds of data types.All these things makes json more flexible,efficient,and simple.

Prev | Next | Index

%d bloggers like this: