nerdexam
CompTIA

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 '[]'…

Scripting, Containers, and Automation

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)
  • A
    91% (29)
  • B
    3% (1)
  • D
    6% (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

#YAML#JSON#Data Serialization#Configuration Files

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice