XK0-005 · Question #24
Which of the following is a difference between YAML and JSON?
The correct answer is A. Users can comment in YAML but not in JSON. YAML supports comments using the '#' character, while the JSON specification explicitly does not support comments. This is a key syntactic difference between the two formats. Option B is incorrect because JSON uses both curly brackets '{}' for objects and square brackets '[]'…
Question
Which of the following is a difference between YAML and JSON?
Options
- AUsers can comment in YAML but not in JSON
- BJSON only curly brackets, while YAML only uses square brackets
- CJSON is used in web development, while YAML is used solely in back-end systems.
- DYAML has been deprecated for JSON.
How the community answered
(32 responses)- A91% (29)
- B3% (1)
- D6% (2)
Explanation
YAML supports comments using the '#' character, while the JSON specification explicitly does not support comments. This is a key syntactic difference between the two formats. Option B is incorrect because JSON uses both curly brackets '{}' for objects and square brackets '[]' for arrays, and YAML uses indentation-based structure rather than only square brackets. Option C is incorrect because both YAML and JSON are used broadly across web development, DevOps, configuration management, and APIs - neither is restricted to back-end systems only. Option D is incorrect because YAML is actively maintained and widely used (e.g., in Kubernetes, Docker Compose, and CI/CD pipelines); it has not been deprecated.
Topics
Community Discussion
No community discussion yet for this question.