JSON/JSON Multiple choice Questions Sample Test,Sample questions

Question:
 In modern websites what is the common usage for JSON?

1.To store information remotely.

2.To send and receive bits of data.

3.To store information locally.

4.None of these

Posted Date:-2022-07-29 10:32:08


Question:
 In the below notation, Employee is of type { “Employee”: { “Name”: “Amy”, “Age”: 25 } }

1.Object

2.Array

3.Class

4.Not a valid JSON string

Posted Date:-2022-07-29 10:35:20


Question:
 In this example, what is the TYPE of employee?
{ “employee” : { “type” : “Director”, “functions” : [‘sales’, ‘marketing’] } }

1. String .

2.Director

3.type

4.Object

Posted Date:-2022-07-29 10:37:09


Question:
 In this example, what would the TYPE of employee.hireDate be?
{ “employee” : { “type” : “Director”, “functions” : [‘sales’, ‘marketing’], “hireDate” : “March 8, 2011” } }

1.March 8, 2011

2.String

3.Date

4.Number

Posted Date:-2022-07-29 11:15:33


Question:
 In what situation would you want to use XML over JSON?

1.When JSON is not offered.

2.When you need to use tags to structure your content

3. You need message validation or you’re using XSLT.

4. Never, JSON is worlds better.

Posted Date:-2022-07-29 11:21:53


Question:
 What error does JSON.parse() throw when the string to parse is not valid JSON?

1. ReferenceError

2.EvalError

3.SyntaxError

4.TypeError

Posted Date:-2022-07-29 11:29:10


Question:
 What is the value of json in the following code?
var cars = []; cars[0] = ‘Ford’; cars[1] = ‘Toyota’; cars[2] = ‘BMW’; var json = JSON.stringify({x: cars});

1. {“x”:[‘Ford’,’Toyota’,’BMW’]}

2. {“x”:{“Ford”,”Toyota”,”BMW”}}

3.{“x”:[“Ford”,”Toyota”,”BMW”]}

4. {“cars”:[“Ford”,”Toyota”,”BMW”]}

Posted Date:-2022-07-29 11:45:24


Question:
 When coding a string object in JSON, what must separate the string and the value?

1.A space

2.A semicolon

3.A comma

4.A colon

Posted Date:-2022-07-29 11:18:29


Question:
 Which statement about the toJSON method is true?

1. It customizes JSON stringification behavior

2.It allows an object to determine its own JSON representation

3.All three statements are true

4.It is internally called by JSON.stringify()

Posted Date:-2022-07-29 10:58:03


Question:
 Who is the Father of JSON ?

1. Douglas Crockford

2.Rasmus Lerdorf

3.Douglas Michel

4.Dennis Ritchie

Posted Date:-2022-07-29 12:27:53


Question:
. For What is a JSONStringer used for?

1.To converts JSON to Java strings

2.To quickly create JSON text

3. To quickly create JSON text

4. To quickly create JSON text

Posted Date:-2022-07-29 12:50:38


Question:
. The MIME type of JSON is -
    

1.application/json

2.application/x-json

3.application/javascript

4.text/json

Posted Date:-2022-07-29 12:29:06


Question:
Can you use a double quote inside a JSON string?

1. Yes, if you use the ascii code.

2.Yes, you can use it without any special treatment

3.Yes, if it is escaped like ( ” )

4.No, you should use single quotes

Posted Date:-2022-07-29 11:03:59


Question:
Can you use a double quote inside a JSON string?

1. No, you should use single quotes

2.Yes, if you use the ascii code.

3.Yes, if it is escaped like ( " )

4. Yes, you can use it without any special treatment

Posted Date:-2022-07-29 12:48:27


Question:
Does JSON support Unicode characters?
A. 

1.No, JSON has no support for any kind of character encoding.

2.No, JSON only has support for UTF-8 characters

3.Yes, JSON has support for Unicode characters. Allowing for almost any information in any human language

4.Yes, only when stored as the key in a ( key : value ) pair.

Posted Date:-2022-07-29 11:19:25


Question:
Does whitespace matter in JSON?

1.No, it will be stripped out.

2.Yes, only within strings

3.Yes, only outside of strings

4.Yes, both inside and outside of strings

Posted Date:-2022-07-29 11:41:05


Question:
Given this JSON example:
{ “Employee”: { “Name”: “Amy”, “Age”: 25 } }; What is the type of Employee.Age ?

1.Number

2.Object

3.Array

4.String

Posted Date:-2022-07-29 10:38:28


Question:
How does JSON being “lightweight” translate into a benefit for the site visitors?

1.Faster transfer times over the internet

2.Parsing JSON is noticeably faster than parsing XML

3.Web apps have a smaller footprint

4.None of These

Posted Date:-2022-07-29 11:27:58


Question:
How does JSON handle numeric values that cannot be represented by a sequence of digits (like Infiniti and Nan)?

1. They are stored as strings and then converted when parsed.

2.They are not permitted.

3.They are stored fine but it’s the parsers job to convert them to numeric values.

4.None of these

Posted Date:-2022-07-29 12:13:05


Question:
In the below notation, Employee is of type { “Employee”: [ “Amy”, “Bob”, “John” ] }

1.Not a valid JSON string

2.Array

3.Class

4.Object

Posted Date:-2022-07-29 10:27:55


Question:
In this example, what is the TYPE of employee.functions?
{ “employee” : { “type” : “Director”, “functions” : [‘sales’, ‘marketing’] } }

1. String

2.Object

3.Array

4.Sales, Marketing

Posted Date:-2022-07-29 11:05:17


Question:
In this example, what is the VALUE of employee.type?
{ “employee” : { “type” : “Director”, “functions” : [‘sales’, ‘marketing’] } 

1.String

2.Object

3.Director

4.None of These

Posted Date:-2022-07-29 11:14:37


Question:
In this example, what would the VALUE of employee.functions[1] be?
{ “employee” : { “type” : “Director”, “functions” : [‘sales’, ‘marketing’] } 

1.null

2.undefined

3.marketing

4.sales

Posted Date:-2022-07-29 11:11:44


Question:
JSON elements are separated by

1.semi-colon

2.line break

3.comma

4. white space

Posted Date:-2022-07-29 10:43:49


Question:
JSON elements are separated by the -

1. line break

2.semi-colon

3.comma

4. white space

Posted Date:-2022-07-29 12:37:59


Question:
JSON name/value pair is written as

1.name’ : ‘value’

2.name = ‘value

3.name = “value”

4. “name” : “value”

Posted Date:-2022-07-29 10:26:04


Question:
JSON stands for ________________

1. Java Standard Output Network

2.JavaScript Object Notation

3.JavaScript Output Name

4.Java Source Open Network

Posted Date:-2022-07-29 12:21:54


Question:
JSON strings have to be in

1.single quote

2.double quote

3.single quote or double quote

4.None of These

Posted Date:-2022-07-29 10:27:10


Question:
JSONP stands for -

1. JSON Parsing

2.JSON Procedures

3.JSON Programming

4.JSON with padding

Posted Date:-2022-07-29 12:30:27


Question:
True or false? A disadvantage of JSON is that it requires the use of JavaScript.

1.False, JSON is language independent.

2.False, JavaScript must be available although it is not necessary to use.

3.True, though all browsers have JavaScript enabled.

4.True, though JavaScript is readily available in today’s browsers.

Posted Date:-2022-07-29 11:00:03


Question:
What are two main structures compose JSON?

1. Arrays and Objects

2.Keys and values

3.Class and Objects

4. None of above

Posted Date:-2022-07-29 12:52:00


Question:
What does JSON stand for?

1.JavaScript Object Nomenclature

2.JavaScript Objective Notation

3.JavaScript Object Notation

4.JavaScript Orientated Nomenclature

Posted Date:-2022-07-29 10:42:46


Question:
What does JSONP stand for?

1.JSON Procedures

2.JSON Parsing

3. JSON with padding

4.JSON Programming

Posted Date:-2022-07-29 12:09:46


Question:
What extension in used to save a JSON file?

1. .json .

2..js .

3.javaN

4.on

Posted Date:-2022-07-29 12:46:41


Question:
What function will convert a JavaScript object to a JSON string?

1.JSON.text()

2.JSON.serialize()

3.JSON.toString()

4.JSON.stringify()

Posted Date:-2022-07-29 11:10:44


Question:
What is a JSONStringer used for?

1.It is used to quickly create JSON text.

2. It quickly converts JSON to Java strings.

3.It is used to create number strings in JSON.

4.It is used to create JSON ordered pairs.

Posted Date:-2022-07-29 11:22:53


Question:
What is JSONP meant to mitigate?

1.Size constraints of JSON

2.Cross-domain communication

3.Future proofing JSON as JavaScript changes.

4.None of these

Posted Date:-2022-07-29 11:16:33


Question:
What is the file extension of JSON?

1..jn

2..js

3..jsn

4.json

Posted Date:-2022-07-29 10:31:16


Question:
What is the MIME type of JSON?

1. application/x-json

2. text/json

3.application/json

4.application/javascript

Posted Date:-2022-07-29 11:13:12


Question:
What is the value of json in the following code?
var days = {}; days[‘Monday’] = true; days[‘Wednesday’] = true; days[‘Sunday’] = false; var json = JSON.stringify({x: days});

1.{“day”:{“Monday”:”true”,”Wednesday”:”true”,”Sunday”:”false”}}

2. {“x”:{“Monday”:true,”Wednesday”:true,”Sunday”:false}}

3.{“day”:{“Monday”:true,”Wednesday”:true,”Sunday”:false}}

4.{“x”:[“Monday”:true,”Wednesday”:true,”Sunday”:false]}

Posted Date:-2022-07-29 11:26:39


Question:
What is the value of json in the following code?
var obj = { fruit: ‘apple’, toJSON: function () { return ‘orange’; } }; var json = JSON.stringify({x: obj});

1.{“x”:”orange”}

2.{“fruit”:”apple”}

3.{“x”:”apple”}

4.{“fruit”:”orange”}

Posted Date:-2022-07-29 11:47:18


Question:
What is the value of obj in the following code?
var obj = JSON.parse(‘{“fruit”: “Apple”}’, function(k, v) { if (v == “Apple”) return “Orange” else return v; });

1.{ “fruit” : “Apple”}

2. { “fruit” : “Orange”}

3. {“Orange”}

4. {“Apple”}

Posted Date:-2022-07-29 11:20:31


Question:
What is used by the JSONObject and JSONArray constructors to parse JSON source strings?

1.JSONTokener

2.JSONParser

3.JParser

4.ParserJ

Posted Date:-2022-07-29 12:15:06


Question:
What keywords are reserved in JSON and cannot be used as keys?

1.Value

2.Object

3.There are none

4.Key

Posted Date:-2022-07-29 10:45:39


Question:
What kind of format is JSON, and what does the acronym mean?

1. A lightweight data-encoding framework. Java Omnipresent Notation.

2.A lightweight data-interchange format. JavaScript Object Notation.

3.A lightweight data-interchange format. Java Objective Notion.

4.A lightweight database framework. JavaScript Object Notation.

Posted Date:-2022-07-29 11:02:48


Question:
What two structures is JSON built on?

1. A collection of name/value pairs, and an ordered list of values, or array.

2.A collection of object/item pairs, and an ordered list of pairs, or array.

3.A collection of name/value objects, and an ordered list of objects, or array.

4.A collection of native-value pairs, and an ordered list of arrays, or values.

Posted Date:-2022-07-29 11:30:22


Question:
What types of values can you have in JSON key:value pairs?

1.Strings, Arrays, and Primitives

2. Arrays, Primitives, and Objects stored as strings

3.Strings, Arrays, Primitives and Objects

4.Strings only

Posted Date:-2022-07-29 11:48:34


Question:
Which answer represents the following order of TYPES? Object, String, Boolean, Number

1.“{ }”, “a string”, “false”, “0”

2.[ ], 0, “true”, “0”

3.{ }, “0”, false, 0

4. { }, hello, “false”, “0”

Posted Date:-2022-07-29 10:36:11


Question:
Which is correct format of writting JSON name/value pair

1. 'name : value'

2.name = 'value'

3.name = "value"

4. "name" : "value"

Posted Date:-2022-07-29 12:24:38


Question:
Which is true about JSON namespacing?

1.JSON namespaces can be accessed immediately after receiving data.

2.JSON namespaces can be accessed after parsing data.

3.JSON doesn’t have namespaces. Though every object is inherently a namespace.

4.None of These

Posted Date:-2022-07-29 11:01:30


Question:
Which of following statement is false about the space parameter in JSON.stringify() ?

1.It controls spacing in the resulting JSON string

2.It is an optional parameter

3. It removes whitespace

4.All are false

Posted Date:-2022-07-29 12:42:05


Question:
Which of the following code will not throw an error?

1.JSON.parse(”);

2.JSON.parse(null);

3.JSON.parse();

4.JSON.parse({});

Posted Date:-2022-07-29 12:11:53


Question:
Which of the following code will return a valid JSON object?

1.JSON.parse(‘({“FirstName”: “John”, “LastName”:”Doe”})’);

2.JSON.parse(“{‘FirstName’: ‘John’, ‘LastName’:’Doe’}”);

3.JSON.parse(“({‘FirstName’: ‘John’, ‘LastName’:’Doe’})”);

4.JSON.parse(‘{“FirstName”: “John”, “LastName”:”Doe”}’);

Posted Date:-2022-07-29 10:33:07


Question:
Which of the following code will throw an error?

1.JSON.parse(null);

2. JSON.parse(‘{}’);

3.JSON.parse(undefined);

4.JSON.parse(‘[]’);

Posted Date:-2022-07-29 10:56:56


Question:
Which of the following code will throw an error?

1.JSON.parse(‘{}’);

2.JSON.parse(null);

3.JSON.parse(undefined);

4.JSON.parse(‘[]’);

Posted Date:-2022-07-29 12:33:31


Question:
Which of the following control characters cannot be used when writing a JSON string without escaping?

1. ; or :

2.“ or

3. < or >

4./ or {

Posted Date:-2022-07-29 11:24:10


Question:
Which of the following is a valid JSON string?

1. { “meals” : { “breakfast” , “lunch” , “dinner” } }

2.{ “meals” : [ “breakfast” , “lunch” , “dinner” ] }

3. [ “meals” : { “breakfast” , “lunch” , “dinner” } ]

4. [ {“meals” : { “breakfast” , “lunch” , “dinner” } } ]

Posted Date:-2022-07-29 10:56:00


Question:
Which of the following is not a JSON type?

1.Object

2.date

3.Array

4.string

Posted Date:-2022-07-29 10:29:17


Question:
Which of the following is not a type in JSON?

1. date

2.Object

3.Array

4.string

Posted Date:-2022-07-29 12:25:53


Question:
Which of the following is not a valid way to parse JSON string?

1.JSON.eval()

2.JSON.parse()

3.jQuery.parseJSON()

4. eval()

Posted Date:-2022-07-29 11:40:05


Question:
Which of the following number formats are not used in JSON?

1.Octal and gate

2.Octal and binary

3.Binary and hexadecimal

4.Octal and hexadecimal

Posted Date:-2022-07-29 12:14:15


Question:
Which of these data interchange formats has seen a decline in usage in favor of JSON?

1. ASCII

2.Plain-text

3.SQL

4.XML

Posted Date:-2022-07-29 10:58:57


Question:
Which of these is a benefit JSON has over XML?

1.JSON is more forgiving of poor formatting

2.JSON has less markup requirements and therefore is lighter than XML

3.JSON can be written poorly and still be parsed

4.JSON does not need to be stored in a file to be sent remotely

Posted Date:-2022-07-29 10:40:20


Question:
Which of these is correct about the JSON standard?

1.It is an open standard

2.It is privately developed

3.It requires a license to use

Posted Date:-2022-07-29 10:30:08


Question:
Which of these is proper a JSON array?

1. { “letters” : [ “a”, “b”, “c”; ] }

2. { ‘letters’ : {“a”, “b”, “c” } }

3. { “letters” : [ a, b, c ] }

4. { “letters” : [ “a”, “b”, “c” ] }

Posted Date:-2022-07-29 10:34:15


Question:
Which of these is supported as a JSON Value type?

1. Infiniti

2.Null

3.Undefined

4.NaN

Posted Date:-2022-07-29 11:17:36


Question:
Which statement about the reviver parameter in JSON.parse() is true?

1. All three statements are true

2.Used to reform generic objects into instances of pseudo-classes

3.A function that will be called for every key and value at every level of the final result

4.Each value will be replaced by the result of the reviver function

Posted Date:-2022-07-29 11:06:30


Question:
Which statement about the reviver parameter in JSON.parse() is true?

1. All three statements are true

2.Used to reform generic objects into instances of pseudo-classes

3.A function that will be called for every key and value at every level of the final result

4.All of the above

Posted Date:-2022-07-29 11:09:44


Question:
Which statement about the space parameter in JSON.stringify() is false?

1.It controls spacing in the resulting JSON string

2. All three statements are false

3. It removes whitespace

4. It is an optional parameter

Posted Date:-2022-07-29 12:17:20


Question:
__________is not a valid way to parse JSON string.

1. JSON.parse()

2. JSON.eval()

3.jQuery.parseJSON()

4. None of the above

Posted Date:-2022-07-29 12:31:50


More MCQS

  1. JSON Multiple choice Questions
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!