11.) Which of the following data types can JSON arrays contain?
A) Only strings
B) Only numbers
C) Mixed data types
D) Only objects
12.) Can a JSON object be empty?
A) Yes
B) No
C) Only in arrays
D) Only in objects
13.) Can a JSON object be empty?
A) Yes
B) No
C) Only in arrays
D) Only when nested
14.) Which of the following values can be used as JSON keys?
A) Strings only
B) Strings and numbers
C) Strings and booleans
D) Any data type
15.) Which of the following values is not valid in JSON?
A) “Hello”
B) 123
C) undefined
D) null
16.) Which of the following is the correct JSON format for a key-value pair?
A) {key: value}
B) {key = value}
C) {“key”: value}
D) {“key”: “value”}
17.) Which of the following is true about JSON numbers?
A) They must include a decimal point.
B) They cannot be negative.
C) They support both integers and floats.
D) They must be enclosed in double quotes.
18.) Which of these is NOT allowed in JSON arrays?
A) Mixed data types
B) Nested arrays
C) Objects as elements
D) Functions as elements
19.) Can JSON objects contain duplicate keys?
A) Yes, with an error
B) No
C) Yes, the last key-value pair overrides the previous ones
D) Yes, but only for strings
20.) What will be the result of parsing the following JSON?
'{"name": "Alice", "age": "25", "age": "30"}'
A) Syntax Error
B) Both age values are stored
C) The first age value is kept
D) The second age value overrides the first
Related