Latest JSON Interview Questions for Freshers

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

JSONXML
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 tagXML have end tag.
JSON is shorterXML is larger than JSON.
JSON is quicker to read and writeXML is not.
JSON can use arraysXML 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.

Related

Interview Questions 2863065606352493724

Post a Comment

emo-but-icon

item