Q1. Who is founder of JSON?
Ans: The Founder of the JSON is Douuglas Crockfrord.
Q2. What is JSON Syntax ?
Exp: The JSON Syntaxt is a set of the JavaScript Object and
you must follow rules for that when you will create JSON.
- The curly brackets hold objects.
- A data is in name and value paires
- The square bracket holds arrays
- A data is separated by comma
- Json is text base
Q3. Why JSON is popular?
Ans: Becuase the JSON is light weith stander for exchanges
infomraiotn:
- JSON is independent of language
- It is easy for reading and writing for humans
and machine.
- It is easy for Encoding and Decode.
- It is mostly used in Mobile application.
- Most of browse is support like as IE8,Opera
10,Crome and Firefox
Q4. What type of data Supported by JSON?
Ans: Bellow the Data type support by JSON inclide.
- Array
- Number
- Null
- String
- Object and
- Boolean
Q5. What is difference in JSON and JSONP?
Ans:
- JSON: The json is sample data format used for the communication
mudium between other System and
- JSONP :Yhe JSONP is methodology for using that
foramt with cross domain Ajax request while not being affected by same origin policy issue.
Q.6 Sample example on JSON in java ?
Ans:
Step 1: Added bellow entery into you pom.xml file
>dependency <
>groupId<com.googlecode.json-simple>/groupId <
>artifactId<json-simple>/artifactId <
>version<1.1.1>/version <
>/dependency <
Step 2:Write the Sampel java Example
SampleJSON.java
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import java.io.FileWriter;
import java.io.IOException;
public class SampleJSON {
obj.put("name", "java-webWorld.blogspot.in");
obj.put("age", new Integer(30);
JSONArray list =
new JSONArray();
list.add("Strong 1");
list.add("Good 2");
list.add("Bad 3");
}
Step 3:When you will Execute above this java class ,you will
get bellow result
{
"age":30,
"name":"java-webWorld.blogspot.in",
"messages":["Strong 1","Good 2","Bad
3"]
}
No comments:
Post a Comment