11.) What is the correct JSON format for a boolean value?
A) “true” or “false”
B) True or False
C) true or false
D) TRUE or FALSE
12.) Can a JSON object have duplicate keys?
A) Yes
B) No
C) Only in arrays
D) Only in nested objects
13.) What happens when duplicate keys are present in a JSON object?
A) An error is thrown.
B) The first key-value pair is ignored.
C) The last key-value pair overrides the previous ones.
D) Both key-value pairs are stored.
14.) Can JSON objects be nested inside other JSON objects?
A) Yes
B) No
C) Only with arrays
D) Only with strings
15.) What is the root element of a JSON document?
A) An object or array
B) A string
C) A number
D) A key-value pair
16.) Which of the following is a valid JSON string?
A) ‘Hello’
B) “Hello”
C) Hello
D) “Hello”
17.) Which of these is a valid JSON array of strings?
A) [apple, banana, cherry]
B) [“apple”, “banana”, “cherry”]
C) [‘apple’, ‘banana’, ‘cherry’]
D) [“apple”, ‘banana’, “cherry”]
18.) Which of the following is a valid JSON array?
A) {[1, 2, 3]}
B) [1, 2, 3]
C) (1, 2, 3)
D) <1, 2, 3>
19.) Which of these is valid for a JSON number?
A) 1.23
B) 123e5
C) -456
D) All of the above
20.) What happens if there is a syntax error in a JSON file?
A) It gets ignored.
B) The JSON file still works.
C) It will fail to parse.
D) It displays a warning but continues.
Related