Latest JSON Interview Questions for Freshers
https://www.computersprofessor.com/2017/09/latest-json-interview-questions-for.html
What is JSON ?
JSON JavaScript Object Notation is language independent, lightweight data-interchange format, "self-describing" and easy to understand. Json mainly use javascript syntex but it format in only text. just like XML.
Full form of JSON ?
JSON stand for JavaScript Object Notation.
Why use JSON ?
JSON is simpler and easier than XML. In place of XML we use JSON.
What are advantage of JSON ?
- It is easy to understand and use
- It is alternative of XML.
- It is is language independent, it means you can you JSON with any language.
- It is a lightweight data-interchange format.
Explain Uses of JSON ?
A common use of JSON is to read data from a web server, and display the data in a web page.
How to denote Objects in JSON.
Example
{"firstName":"Komal", "lastName":"Pandit"}
Give syntax for JSON Arrays
Example
"employees":[ {"firstName":"Komal", "lastName":"Pandit"}, {"firstName":"Gaurav", "lastName":"Rawat"}, {"firstName":"Hitesh", "lastName":"Kumar"} ]
Differences between JSON and XML
JSON | XML |
---|---|
JSON stands for JavaScript Object Notation. | XML stands for eXtensible Markup Language. |
It is simple to read and write. | Compare to JSON XML is less simple. |
It is data-oriented. | XML is document-oriented. |
It is less secured than XML. | It is more secured. |
JSON doesn't use end tag | XML have end tag. |
JSON is shorter | XML is larger than JSON. |
JSON is quicker to read and write | XML is not. |
JSON can use arrays | XML do not have an array. |
Similarities between JSON and XML
- Both are simple and open.
- Both are language-independent.
- Both are self describing (human readable)
- Both are hierarchical (values within values)
- JSON and XML can be parsed and used by lots of programming languages
- JSON and XML can be fetched with an XMLHttpRequest
- JSON and XML supports unicode. So internationalization is supported by JSON and XML both.