CompTIA Linux+ (XK0-004) — Question 21
Which of the following is a difference between YAML and JSON?
Answer options
- A. Users can comment in YAML but not in JSON
- B. JSON only uses curly brackets, while YAML only uses square brackets
- C. JSON is used in web development, while YAML is used solely in back-end systems.
- D. YAML has been deprecated for JSON.
Correct answer: A
Explanation
The correct answer is A because YAML permits comments, which enhances readability and documentation, while JSON does not allow comments. Options B and C are incorrect as both JSON and YAML have flexible syntax, and both can be used in various contexts beyond those mentioned. Option D is also false as YAML is not deprecated; it is still widely used alongside JSON.